general-discussion > Errors trying to segment T1w images.
Showing 1-4 of 4 posts
Display:
Results per page:
Apr 15, 2011  02:04 AM | U P
Errors trying to segment T1w images.


Hi , congratulations on this work and thanks for sharing it.
I want to segment T1w MR axial images using NIAK. I only write my input file
and I let the default options for the name of the output and the structure opt.
The directory I use for the images is bricks/t1_ processing.  I have been trying but I have errors. Please,
could you help me to solve them?



When I use an example image yours, [files_in,files_out,opt]
= niak_brick_mask_brain_t1('func_motor_subject1_a_mc_f_p_res_s.nii')

 I have the following
errors:   




Deriving a segmentation of the T1 image using Otsu intensity threshold
... 0.754 sec.

Competitive region growing starting from dense white matter regions ...

     Building a spatial density
map ... 28.03 secs.

     Extracting connected
clusters in dense voxels ... 35.20 secs. 3322 dense core clusters were found.

     Propagation of cluster
labels, number of iterations :

??? Error using ==> or

Inputs must have the same size.

 

Error in ==> niak_clustering_space_density at 184

    mask_todo =
mask_todo|mask_extra;

 

Error in ==> niak_mask_brain_t1 at 206

mask_brain =
niak_clustering_space_density(mask_conf,mask_head,opt.region_growing);

 

Error in ==> niak_brick_mask_brain_t1 at 239

mask = niak_mask_brain_t1(anat,opt_mask)

 

 

 

And then with my image .img:

 

Deriving a segmentation of the T1 image using Otsu intensity threshold
... 3.839 sec.

Competitive region growing starting from dense white matter regions ...

     Building a spatial density
map ... 32.65 secs.

     Extracting connected
clusters in dense voxels ... 26.33 secs. 30 dense core clusters were found.

     Propagation of cluster
labels, number of iterations :

??? Error using ==> save

Unable to write file \tmp\niak_tmp_814723686_vol.mnc: No such file or
directory.

(But I have created a folder called tmp)

 

Error in ==> niak_file_tmp at 63

save(file_name,'flag_tmp')

Error in ==> niak_morph at 88

file_tmp = niak_file_tmp('_vol.mnc');

 

Error in ==> niak_clustering_space_density at 192

        mask_border_new =
niak_morph(mask_border,['-successive D' arg_m]); % dilate the

        border

 

Error in ==> niak_mask_brain_t1 at 206

mask_brain =
niak_clustering_space_density(mask_conf,mask_head,opt.region_growing);

 

Error in ==> niak_brick_mask_brain_t1 at 239

mask = niak_mask_brain_t1(anat,opt_mask)

 

Thanks very much,

Regards

Apr 15, 2011  08:04 AM | Pierre Bellec
RE: Errors trying to segment T1w images.
Dear UP,

From the examples you sent, it seems you only tried with NIFTI images (.nii/.img). As is explained in the doc of NIAK, currently the only file format that is supported is MINC. The NIFTI format will be supported sometimes this year but currently anything that uses the MINC tools (including the brain segmentation) will fail. Please have a look at the installation section of the wiki to see how to install the MINC tools. When you have them installed, you can run a NII2MNC on your images to convert them into MINC.

Also note that the segmentation algorithm you tried is only used as a first (rough but hopefully robust) guess before linear coregistration in stereotaxic space. The final segmentation is based on a non-linear fit in stereotaxic space. You can generate it using NIAK_BRICK_T1_PREPROCESS (but you will definitely need the MINC tools installed for that). 

I hope you will manage to get past this annoying installation stage, and I wish you good luck with your data processing,

Pierre
Apr 18, 2011  01:04 AM | U P
RE: Errors trying to segment T1w images.
Hi, thanks very much for answering. My images are DICOM, so I convert them into NIFTY(.img, .hdr), with MRIConvert and then I'll need to use niak_brick_nii2mnc. My laptop has Windows7 64bits but I have seen that MINC tools are for win32 so I'm using a virtual machine with XP 32bits. Sorry for asking with so much detail.

For installing MINC tools I followed the Binary Instructions, I downloaded "mni-2006-11-15.tar.gz"  (I don't know where to put it). Then I downloaded Cygwin, and I chosed the option for installing X11.
After that I downloaded the binary tools for win 32:minc-2.0.15_SEP04_08.exe. So then I didn't understood the last step($ tar zxvf minc-xxxxxx.tar.gz) because my file isn't in tar.gz, and I wrote the following on Cygwin:
cd C:/cygwin/usr/local and then ./minc-2.0.15_SEP04_08.exe      A screen appeared and it was installed successful. Have I done the correct thing?
Are this way MINC tools installed? 
Then in MATLAB's path I have the niak package, the folder of MINC tools and the folder called mni-2006-11-15.tar.gz unziped. Can i follow the steps explained
in: FmriPreprocessing more or less for T1w MRI, despite not being fMRI?


Thanks very much and sorry for the messy message.
Regards.
Apr 21, 2011  12:04 AM | U P
RE: Errors trying to segment T1w images.
Hi, finally I have moved to Ubuntu in a virtual machine, don't care about my previous message. At the moment I have converted NIFTI into MNC successfully, I'm going to continue and then I'll ask doubts (because for example I have errors with nu_correct and with the T1w demos)

Thanks
Regards