I am using the ImageMath script in order to calculate the Dice coefficient of two images. I have 2 questions that I'm hoping to get answered.
My first question pertains to the outputs. When the script runs there are 3 outputs. A csv file and two nifti files. The csv file tells me the overlap of different regions but what are the two nifti (dice.nii & mds.nii) files?
Secondly, I was wondering if the nifti files should reflect the size of the input images. To rephrase, if my input images are roughly 68MB should the nifti output files also be around 68MB?
Thanks for the help,
Brad
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the ImageMath script in order to calculate the Dice coefficient
of two images. I have 2 questions that I'm hoping to get answered.
My first question pertains to the outputs. When the script runs there are
3 outputs. A csv file and two nifti files. The csv file tells me the
overlap of different regions but what are the two nifti (dice.nii &
mds.nii) files?
Secondly, I was wondering if the nifti files should reflect the size of
the input images. To rephrase, if my input images are roughly 68MB should
the nifti output files also be around 68MB?
I meant to add a final issue that I was coming across. If I were to take two unrelated images run DiceAndMinDistSum I get a csv file with upwards of 130+ label names. If I were to take one of these same images and run DiceAndMinDistSum against a normalized template (created using ANTs) I get 1 label name with 0's running across the columns. What could be the cause of this?
Thank you once again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I meant to add a final issue that I was coming across. If I were to take
two unrelated images run DiceAndMinDistSum I get a csv file with upwards of
130+ label names. If I were to take one of these same images and run
DiceAndMinDistSum against a normalized template (created using ANTs) I get
1 label name with 0's running across the columns. What could be the cause
of this?
What I'm entering is [ImageMath 3 /infinite1/infinite/imaging_data/testing_ants_complete/output1 DiceAndMinDistSum /infinite1/infinite/imaging_data/testing_ants_complete/subject191.nii /infinite1/infinite/imaging_data/testing_ants_complete/T1.nii]
minus the brackets. where output1 is the name of my output, subject191.nii is my first image and T1.nii is the normalized template. Do you see any issue with the code I'm using to run DiceAndMinDistSum?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What I'm entering is [ImageMath 3
/infinite1/infinite/imaging_data/testing_ants_complete/output1
DiceAndMinDistSum
/infinite1/infinite/imaging_data/testing_ants_complete/subject191.nii
/infinite1/infinite/imaging_data/testing_ants_complete/T1.nii]
minus the brackets. where output1 is the name of my output, subject191.nii
is my first image and T1.nii is the normalized template. Do you see any
issue with the code I'm using to run DiceAndMinDistSum?
i don't think there is a program called ANT.sh ... anyway, you need to
apply a mapping to a labeled image and use an appropriate interpolation
scheme ( eg nearest neighbor ) to resample it in the target space.
there are many examples of this in the literature. in ants, you just need
two programs, antsRegistration and antsApplyTransforms, to do this.
The program LabelOverlapMeasures is also available in ANTs which gives you additional measures aside from Dice. You might get a better idea of label images if you read the accompanying Insight Journal article and look at some of the examples.
I used this code to check the overlap between the warped label image of an image (in the population) to the template. Thanks for such useful code,
Is my understanding correct that once we want to check the validity of the template construction, we should calculate the overlapping measures between template and warpedlabel?
what is the column Total/Target in the ouput?
I wanna refer to these measures that you have provided, which publication should I refer?
Last edit: Sara 2019-02-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Again,
Thanks all for helping me so far with ANTs. I have done what has been instructed of me however I believe I’m still missing a step somewhere. When I use the LabelOverlapMeasures command to get both DICE and JACCARD I’ve noticed that my numbers seem extremely low despite what appears to be great congruency between the two images I’m using.
I have used both antsRegistration and antsApplyTransform to apply a mapping to a labeled image and resampled it to a target space. The images look great when overlaid. I have taken a screenshot and it can be seen below (1 image is yellow/orange and the other is grayscale. It is so well done that it is difficult to discern any grayscale at all): http://s0.uploads.im/TGlCJ.jpg
I then used LabelOverlapMeasures (more specifically the command LabelOverlapMeasures 3 normtemp.nii.gz subject1.nii) and I have taken a screenshot of the output: http://s0.uploads.im/Rec2X.jpg
Does the community have any idea why I’m getting numbers that are so low?
Thank you for your time,
Brad
hi - if you can upload jpg images, maybe you can upload nifti images? the
easiest way to get help is to provide reproducible examples. otherwise we
are just guessing at the mistake you have made.
Hello Again,
Thanks all for helping me so far with ANTs. I have done what has been
instructed of me however I believe I'm still missing a step somewhere. When
I use the LabelOverlapMeasures command to get both DICE and JACCARD I've
noticed that my numbers seem extremely low despite what appears to be great
congruency between the two images I'm using.
I have used both antsRegistration and antsApplyTransform to apply a
mapping to a labeled image and resampled it to a target space. The images
look great when overlaid. I have taken a screenshot and it can be seen
below (1 image is yellow/orange and the other is grayscale. It is so well
done that it is difficult to discern any grayscale at all): http://s0.uploads.im/TGlCJ.jpg
I then used LabelOverlapMeasures (more specifically the command
LabelOverlapMeasures 3 normtemp.nii.gz subject1.nii) and I have taken a
screenshot of the output: http://s0.uploads.im/Rec2X.jpg
Does the community have any idea why I'm getting numbers that are so low?
Thank you for your time,
Brad
I didn't know how to post 2 attachments so here is the second nifti file, the normtemp.nii.gz. Again, I am using the command LabelOverlapMeasures 3 normtemp.nii.gz subject1.nii. Any thoughts on how to resolve the issue I'm having (extremely low values for JACCARD and DICE)?
Dice, Jaccard, and other overlap measures are for labeled images not grayscale images (which is what normtemp.nii.gz and subject.nii are). Read the description here if you're still unclear.
Dice, Jaccard, and other overlap measures are for labeled images not
grayscale images (which is what normtemp.nii.gz and subject.nii are). Read
the description here if you're still unclear.
Hello ANTs community,
I am using the ImageMath script in order to calculate the Dice coefficient of two images. I have 2 questions that I'm hoping to get answered.
My first question pertains to the outputs. When the script runs there are 3 outputs. A csv file and two nifti files. The csv file tells me the overlap of different regions but what are the two nifti (dice.nii & mds.nii) files?
Secondly, I was wondering if the nifti files should reflect the size of the input images. To rephrase, if my input images are roughly 68MB should the nifti output files also be around 68MB?
Thanks for the help,
Brad
hi - the only relevant output is the csv file.
brian
On Tue, Mar 11, 2014 at 11:43 AM, Brad stinson1@users.sf.net wrote:
Great, thank you.
I meant to add a final issue that I was coming across. If I were to take two unrelated images run DiceAndMinDistSum I get a csv file with upwards of 130+ label names. If I were to take one of these same images and run DiceAndMinDistSum against a normalized template (created using ANTs) I get 1 label name with 0's running across the columns. What could be the cause of this?
Thank you once again.
very difficult to say. maybe you've encountered a bug. but it sort of
sounds like you also may be doing something nonsensical.
dice should be computed between two label images ( i.e both images have
label 1 => N ) that exist in the same physical space.
brian
On Tue, Mar 11, 2014 at 12:27 PM, Brad stinson1@users.sf.net wrote:
What I'm entering is [ImageMath 3 /infinite1/infinite/imaging_data/testing_ants_complete/output1 DiceAndMinDistSum /infinite1/infinite/imaging_data/testing_ants_complete/subject191.nii /infinite1/infinite/imaging_data/testing_ants_complete/T1.nii]
minus the brackets. where output1 is the name of my output, subject191.nii is my first image and T1.nii is the normalized template. Do you see any issue with the code I'm using to run DiceAndMinDistSum?
looks fine but it's the combination of code and input data that is
important.
the input data should be label images.
brian
On Wed, Mar 12, 2014 at 2:58 PM, Brad stinson1@users.sf.net wrote:
Label images are the outputs that I should receive after running ANT.sh, correct?
i don't think there is a program called ANT.sh ... anyway, you need to
apply a mapping to a labeled image and use an appropriate interpolation
scheme ( eg nearest neighbor ) to resample it in the target space.
there are many examples of this in the literature. in ants, you just need
two programs, antsRegistration and antsApplyTransforms, to do this.
brian
On Thu, Mar 13, 2014 at 10:17 AM, Brad stinson1@users.sf.net wrote:
The program LabelOverlapMeasures is also available in ANTs which gives you additional measures aside from Dice. You might get a better idea of label images if you read the accompanying Insight Journal article and look at some of the examples.
http://www.insight-journal.org/browse/publication/707
Dear Nick,
I used this code to check the overlap between the warped label image of an image (in the population) to the template. Thanks for such useful code,
Is my understanding correct that once we want to check the validity of the template construction, we should calculate the overlapping measures between
template
andwarpedlabel
?Total/Target
in the ouput?Last edit: Sara 2019-02-26
Try using
LabelOverlapMeasures
instead. That way you can refer any questions to this small technical report.Hello Again,
Thanks all for helping me so far with ANTs. I have done what has been instructed of me however I believe I’m still missing a step somewhere. When I use the LabelOverlapMeasures command to get both DICE and JACCARD I’ve noticed that my numbers seem extremely low despite what appears to be great congruency between the two images I’m using.
I have used both antsRegistration and antsApplyTransform to apply a mapping to a labeled image and resampled it to a target space. The images look great when overlaid. I have taken a screenshot and it can be seen below (1 image is yellow/orange and the other is grayscale. It is so well done that it is difficult to discern any grayscale at all):
http://s0.uploads.im/TGlCJ.jpg
I then used LabelOverlapMeasures (more specifically the command LabelOverlapMeasures 3 normtemp.nii.gz subject1.nii) and I have taken a screenshot of the output:
http://s0.uploads.im/Rec2X.jpg
Does the community have any idea why I’m getting numbers that are so low?
Thank you for your time,
Brad
hi - if you can upload jpg images, maybe you can upload nifti images? the
easiest way to get help is to provide reproducible examples. otherwise we
are just guessing at the mistake you have made.
brian
On Fri, Mar 28, 2014 at 1:50 PM, Brad stinson1@users.sf.net wrote:
Sorry about that (wasn't aware I could upload niftis).
I've attached the nifti files to this thread. Thanks again for the help! Attached is subject1.nii.gz
I didn't know how to post 2 attachments so here is the second nifti file, the normtemp.nii.gz. Again, I am using the command LabelOverlapMeasures 3 normtemp.nii.gz subject1.nii. Any thoughts on how to resolve the issue I'm having (extremely low values for JACCARD and DICE)?
Dice, Jaccard, and other overlap measures are for labeled images not grayscale images (which is what normtemp.nii.gz and subject.nii are). Read the description here if you're still unclear.
http://www.insight-journal.org/browse/publication/707
just to be very clear --- these metrics are for LABEL IMAGES .
i think this was stated very early on and several times in previous replies.
and nick gave you the same reference twice to look over.
so please make some effort to understand what this means.
brian
On Mon, Apr 7, 2014 at 9:57 AM, Nick Tustison ntustison@users.sf.net wrote: