general-discussion > Errors in T1 bricks and demos
Showing 1-7 of 7 posts
Results per page:
Apr 22, 2011  04:04 AM | U P
Errors in T1 bricks and demos

Hi, I have been trying but I only get errors, there is
something I’m missing or maybe I’m distracted. 
Currently, I’m in Ubuntu Maverick, I have converted my 120 axial T1w MR
DICOM images into NIFTI  and then into MNC
with nii2mnc.  I have checked the
following componentes in Ubuntu: libminc-dev, libminc2-1, libmni-perllib-perl
and minc-tools.

I have been trying to run T1 demos without success and then
I have tried with niak_brick_nu_correct (because I have seen in
niak_brick_t1_preprocess.m that is the first of the 10 scrips for he flowchart
of the brick). Do I have to follow the 10 steps for segmenting the brain or
is there a fast way?

I attach a document with my errors, please could you help me
to solve them?

Thanks very much


Attachment: NIAK ERRORS.odt
Apr 23, 2011  01:04 PM | Pierre Bellec
RE: Errors in T1 bricks and demos
Dear UP,

Sorry for the late reply. You certainly made the right move by going for an Ubuntu virtual machine. Looking at the error message you get, it seems like the system cannot find the nu_correct command. There may be two reasons for that. The most likely is that you installed only the "minctools" package. I realized that the installation section of the wiki was not explicit enough regarding the list of required minc packages, which goes beyond the core minc tools. I updated this section, you can have a look here :

If it is available for your version of ubuntu, just install the mincbundle package that includes every single minc package. The tutorial can be found here :

The other possibility is that you installed all of the tools, but somehow there are not found by default of your system. That happens sometimes, even thought the mincbundle package would be supposed to take care of that for you. Here is a tutorial on how to change your .bashrc file to add the minc tools :

When you're done with that, just go in the folder where you have a MINC volume and try in a bash :

nu_correct -distance 200 my_vol.mnc my_vol_nu.mnc

This should run a non-uniformity correction on my_vol.mnc and generate the results in my_vol_nu.mnc. If not then there is something wrong with the installation. In this case please post more details regarding the installation steps you followed. 

Good luck with getting the software to work. The MINC community is currently putting efforts into simplifying the installation documentation and procedure, but there is still much room for imporvement. Your feedback is very much appreciated. 


Pierre Bellec
Apr 24, 2011  03:04 AM | U P
RE: Errors in T1 bricks and demos
Hi Pierre, thanks for answering, specially at weekend. I think I didn't install mincbundle and this is the cause of the errors. I'll try on Tuesday because these days I have other works to do and I'll tell you how it's going. Thank you for updating the explanation of the installation.

Apr 27, 2011  11:04 AM | U P
RE: Errors in T1 bricks and demos

Hi, thank you for the
message, it solved my problems. I
installed mincbundle, then I had to modify the paths and I had
problems with the files' permissions too but now it works. I have tried
only with niak_brick_nu_correct and then with
niak_brick_mask_brain_t1, with the default parameters, but my results
aren't satisfactory.

I attach a screenshot of some slices (the
important ones for me are the axial ones).One question: for a not
very accurate (but better than current segmentation) can I just use
nu_correct and mask_brain_t1 and forget the stereotactic
coregistration etc? In this case, do you think I only have to modify
the parameters in opt for mask_brain_t1?

Thank you very much


Attachment: MASK RESULT.odt
Apr 27, 2011  11:04 AM | Pierre Bellec
RE: Errors in T1 bricks and demos
These results are simply horrible. I have similar problems with one database currently which have large hyper signal in the fat around the brain. I am planning on releasing an update of the procedure which will be robust to these type of effects. I am not sure what tool you used though. If if is NIAK_BRICK_MASK_BRAIN_T1, I would suggest to try NIAK_BRICK_T1_PREPROCESS as well (the linear coregistration is sometimes surprisingly robust to disastrous initial masks, and the subsequent brain extractions use a quite different approach). If you tried both and both failed, then I would need to see an image to figure out what may cause the algo failure. But if it is similar to the problem I ran into, then it is related to a highly skewed histogram with outliers (high) values in the tissues surrounding the brain. Manually clipping the volume may fix your issue :

>> [hdr,vol] = niak_read_vol('file_anat.mnc');
>> hist(vol(:))
>> vol(vol>1000) = 1000;
>> hdr.file_name = 'file_anat_clipped.mnc';
>> niak_write_vol(hdr,vol);

where the value 1000 is an example and needs to be determined based on the histogram. The changes I mentioned above will involve some automated clipping. If you would be willing to share one problematic brain, please email me and I'll have a look. I am very interested in collecting those "hard" brains to test further updates of the brain segmentation/coregistration tools.

Best regards,

Apr 29, 2011  09:04 AM | Pierre Bellec
RE: Errors in T1 bricks and demos
Hi Ursula,Thanks for sending me the images. I just had a quick look at it. This sequence is obviously not a "standard" sequence such as those used in fMRI studies. The tools currently available in NIAK are geared towards processing of fMRI, and are not meant as multi-purpose T1 analysis tools. Having said that, your scans look like an extreme case of a problem I have observed from time to time in T1 images acquired in standard fMRI protocols : massive hyper signal outside of the brain. I'd like to have a version of the algo which would be robust to that. For your project, I actually think that SPM and FSL are likely to fail as well on those images (I may be wrong). I you *need* those brain masks asap, just draw them manually. I recommend ITK SNAP for this task:'ll keep you posted,Pierre
Apr 30, 2011  03:04 AM | U P
RE: Errors in T1 bricks and demos
Hi Pierre, thank you. Meanwhile I'll follow your advice despite wanting an automatic method. Yes, I know my images are this way and maybe the only solution is a manual method, at least to get the mask soon.

Best regards and thank you for your help,