Closed ValeriePineauNoel closed 6 months ago
At minimum, please post the entire error output. Even better, though, would be to post the data so that we can try to reproduce the error on our end.
Alternatively, I would recommend using ANTsPy/ANTsPyNet or ANTsR/ANTsRNet (brain extraction tutorial here.
Yes I would need to see more context from the complete logs. They are often too long to paste but you can do
antsBrainExtraction.sh -d 3 -a Ax_3D_postt1_Mprage_8.nrrd -e <path>/Kirby/S_template3.nii.gz \
-o T1_brain_without_skull.nii.gz 2>&1 | tee abe_command_output.txt
and then upload the text file here.
Hi! Thanks for your quick answers. Indeed I didn't put the logs because it was quite long. Here is the command_output.txt : abe_command_output.txt
Sadly, because I am working with human brain scans, I cannot share my data for ethical reasons. However, I can tell you that my image sequence looks like this, but with a skull : CIT MRI brain.
Thanks! Can you try
antsBrainExtraction.sh -d 3 -a Ax_3D_postt1_Mprage_8.nrrd -e <path>/Kirby/S_template3.nii.gz -o T1_brain_without_skull
It's possible that the extra extensions in the output are causing the problem.
I just tried to reproduce and the extension mangling does not cause a problem for me (ants 2.5.1), neither does using a .nrrd reference image.
Is it possible that you are running out of memory? Is the reference image very large?
My reference image sequence is a .nrrd and has 176 slices. The images are 16-bit and are of dimension 220 X 320 pixels. In total, the file is 24.8 MB. I didn't think the file is too big. Do you know how I could verify if I run out of memory on my MacOS?
I had the same error after trying this :
antsBrainExtraction.sh -d 3 -a Ax_3D_postt1_Mprage_8.nrrd -e <path>/Kirby/S_template3.nii.gz -o T1_brain_without_skull
abe_command_output2.txt
OH, I think I see it now
Using antsBrainExtraction with the following arguments:
image dimension = 3
anatomical image = Ax_3D_postt1_Mprage_8.nrrd
extraction template = /Users/dcclab/Documents/Marc/shavasana_registration/T1-CIT168onpost/BrainTemplates/Kirby/S_template3.nii.gz
extraction reg. mask =
extraction prior =
output prefix = T1_brain_without_skull.nii.gz
output image suffix = nii.gz
You have specified the extraction template, but not the prior probability mask to go with it. Is there a brain mask or brain probability mask to go with S_template3.nii.gz
? You need to have that and pass it to the script with -m
Oh I see! But there are no probability mask with the Kirby brain template. Oasis has a file "...ProbabilityMask.nii.gz" but not the Kirby.
I will try with NKI.
Sorry about that, you can make a mask with
ThresholdImage 3 S_template3_BrainCerebellum.nii.gz S_template3_BrainCerebellumMask.nii.gz 0.01 Inf
Or another template will work also. Note that -m
is where you pass the brain outline, while the optional -f
is for a mask to constrain registration.
Example here for NKI, the brain mask -m
is in red ie (T_template_BrainCerebellumProbabilityMask.nii.gz
)
Oh ok I see! So I could really get any brain template then. I tried it with the NKI and it worked very well. Thank you both for you help! The problem came from the fact that I didn't select a probability mask. abe_command_output3.txt
Describe the problem I have a T1-weighed image sequence from a human head and I want to extract, on each image, the brain and get rid of the skull for registration. I tried this tutorial (Brain extraction in ANTs) with the Kirby brain template provided here (ANTs brain templates). I had an&, unsigned int) + 7909), I'm guessing from the file
ERROR: command exited with nonzero status 139
. From the console, I can see that the error is from the commandantsApplyTransforms
(0x10f91f6a5 int ants::antsApplyTransforms<double, 3u, double>(itk::SmartPointerantsBrainExtraction.sh
.To Reproduce I basically followed this : ANTs brain templates However, instead of putting this command
I put this :
System information (please complete the following information)
ANTs version information
Additional information