loading file from my directory?

3 visualizaciones (últimos 30 días)
Dhafer
Dhafer el 1 de Ag. de 2014
Comentada: Image Analyst el 4 de Ag. de 2014
Dear I would like to download imagej-nii and also ROI (from imageJ software) and calculate the mean and std of the voxels within adjacent 5 slices (3D volume) for 6 animals. I have created code but many errores I have,,,, cause I am so beginner to use matlab.
Sabjects={'animal1', 'animal2', 'animal3','animal4', 'animal5,'animal6'}; % for multi animal calculation.
for i =1: size(subjects,2); image = load - nii(['\MRI\..\'subjects(i)'\roi.nii']); for j = 0:1 region = voxel (mod = = i); deviation (j,i+1)= std (region,[],3); end end
%% this is for one animal image = load-nii ("name of the file"); roi = load-nii ("name of the file"); view-nii (roi); view-nii (image);
region1= voxels ((mod (roi ,2) == 1).* (roi > 0)); region2= voxels ((mod (roi ,2) == 0).* (roi > 0)); deviation = std (region ,[] ,3);
  4 comentarios
Dhafer
Dhafer el 4 de Ag. de 2014
< I would like to download imagej-nii and also ROI (from imageJ software) and calculate the mean and std of the voxels within adjacent 5 slices (3D volume) for 6 animals. I have created code but many errores I have,,,, cause I am so beginner to use matlab. >
< I do not know what is the ROI format, because it is appeaer as text. When I cearch on the ImageJ website, there is now specific format for the ROI. >
% for multi animal calculation.
Sabjects={'animal1', 'animal2', 'animal3','animal4', 'animal5,'animal6'};
for i =1: size(subjects,2);
image = load - nii(['\MRI\..\'subjects(i)'\roi.nii']);
for j = 0:1
region = voxel (mod = = i);
deviation (j,i+1)= std (region,[],3);
end
end
%%this is for one animal
image = load-nii ("name of the file");
roi = load-nii ("name of the file");
view-nii (roi); view-nii (image);
region1= voxels ((mod (roi ,2) == 1).* (roi > 0));
region2= voxels ((mod (roi ,2) == 0).* (roi > 0));
deviation = std (region ,[] ,3);
Image Analyst
Image Analyst el 4 de Ag. de 2014
Do not call variables "image" or "load" since those are the names of built in functions. Also == does NOT have a space between the equals. And what is load-nii? You can't have a function name with a minus sign in it. And, it's not clear what that function returns: an image or some kind of ROI coordinates. And what is "voxel"? Where is function view-nii? Again, you can' thvae a minus sign in the function name. Also, mod is a function so you can't do "mod = = 1". MATLAB is case sensitive so "Sabjects" and "subjects" are two different variables - I don't think that's what you intended. Finally, you can't have indexes of 0. They must start with 1.

Iniciar sesión para comentar.

Respuestas (1)

Mark Hayworth
Mark Hayworth el 1 de Ag. de 2014

Categorías

Más información sobre Red en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by