help > Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
Showing 1-5 of 5 posts
Display:
Results per page:
Aug 24, 2019  12:08 AM | cccoleman
Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
When AutoEaCSF successfully completes, the result is a file of the form _stripped_EMS_withoutVent_FINAL_Partial_CSF_QCistern.nrrd
We want to reduce that file down to a scalar value.  We can do it manually by opening in ITK and looking within the GUI to do stats, but we're looking for an automatic solution.  

There is a command line program, fslstats -V with precisely the needed functionality, but it cannot read nrrds, so I'd have to convert first to an FSL-compatible format .  Looked for a converter, and saw posts that point toward DTIPrep as a potential, but our images are all T1, not DTI/DWI, so I'm uncertain if that would be appropriate or not.

Do you know of a solution?
Aug 25, 2019  01:08 AM | cccoleman
RE: Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
I have a solution -   the Computational Morphometry Toolkit can do this job. 
https://www.nitrc.org/projects/cmtk 

(For future reference, I previously tried pynrrd and np.count_nonzero , but that doesn't work)
Aug 26, 2019  04:08 PM | Martin Styner
RE: Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
Can you add that this to the issue tracker as a feature request, so that we can add the volume measurement computation as the final step?

I also added two of our tools to the download section under the tool package (ImageStat to compute the volume, as well as convertITKformats to convert between ITK supported formats such as NIFTI and NRRD).

Martin
Originally posted by cccoleman:
I have a solution -   the Computational Morphometry Toolkit can do this job. 
https://www.nitrc.org/projects/cmtk 

(For future reference, I previously tried pynrrd and np.count_nonzero , but that doesn't work)
Aug 26, 2019  06:08 PM | cccoleman
RE: Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
Originally posted by Martin Styner:
I also added two of our tools to the download section under the tool package (ImageStat to compute the volume

What command are ya'll using to get your final volume calculation?  

usage: ImageStat infile [-outbase outbase] [-mask maskfile] [-verbose]
[-histo [-min xmin] [-max xmax] [-samp s]]

IS QCistern the infile in this case?  or is the original T1 the infile,    with QCistern being the mask?   

For reference, here's the full help for ImageStat.

ImageStat 1.6 version (4/17/14)For you reference, here's the help for ImageStat. 
computes base statistics of an image
usage: ImageStat infile [-outbase outbase] [-mask maskfile] [-verbose]
[-histo [-min xmin] [-max xmax] [-samp s]]

infile input dataset
-outbase outbase base-outputfilename, if omitted then the same as base of input
-mask file Mask [bytedata, 0/255 value] to mask out image data, where mask is set
-probmask file Mask [shortdata, 0/62000 value] to mask out probabilitically image data, where mask is > 0
-probfactor f Maximum probability value/Probability normalization factor, needs to be set if using -probmask
The proper probability of all values in probmask is computed by division with this value
-verbose verbose mode
-histo Histogram corrected and uncorrected for pixeldimension
-min xmin Minimal value for histogram/volume/labels [DEFAULT masked_minval]
-max xmax Maximal value for histogram/volume/labels [DEFAULT masked_maxval]
-samp s Number of Samples for histogram/volume [DEFAULT xmax-xmin]
-threeSlice[C x,y,z] create three orthogonal views through the image center or the optionally supplied coordinate
-info print image info on standard out
-label labelfile give volume, mean intensity, standard deviation, min, max, quantiles for each label
-display display the results on the standard output (if -volumeSummary and/or -intensitySummary used, display theresults of these options)
-quantile [list of numbers separate by a coma] quantile value [DEFAULT: 1 5 33 50 66 95 99]
-maskForLabel maskForLabelfile binary mask
-probabilityMap probabilitymap use probability map to compute volume, mean intensity etc.
-volumeSummary give volume for each label
-fillEmpty provide feedback for all possible labels from min to max (see -min, -max)
-intensitySummary give mean intensity, standard deviation, min, max, quantiles for each label
-volOverlap labelFile compute Tanimoto (intersection over union), Dice coefficient and Hausdorff distance of input label image with additional image
Caution: option min/max currently only work for -label
Aug 26, 2019  07:08 PM | Martin Styner
RE: Automatically quantify final outputs ("*_QCistern.nrrd") via commandline
there are multiple options, I would use

ImageStat T1image.nrrd -label segmentation.nrrd -volumeSummary -display

Best
Martin
Originally posted by cccoleman:
Originally posted by Martin Styner:
I also added two of our tools to the download section under the tool package (ImageStat to compute the volume

What command are ya'll using to get your final volume calculation?  

usage: ImageStat infile [-outbase outbase] [-mask maskfile] [-verbose]
[-histo [-min xmin] [-max xmax] [-samp s]]

IS QCistern the infile in this case?  or is the original T1 the infile,    with QCistern being the mask?   

For reference, here's the full help for ImageStat.

ImageStat 1.6 version (4/17/14)For you reference, here's the help for ImageStat. 
computes base statistics of an image
usage: ImageStat infile [-outbase outbase] [-mask maskfile] [-verbose]
[-histo [-min xmin] [-max xmax] [-samp s]]

infile input dataset
-outbase outbase base-outputfilename, if omitted then the same as base of input
-mask file Mask [bytedata, 0/255 value] to mask out image data, where mask is set
-probmask file Mask [shortdata, 0/62000 value] to mask out probabilitically image data, where mask is > 0
-probfactor f Maximum probability value/Probability normalization factor, needs to be set if using -probmask
The proper probability of all values in probmask is computed by division with this value
-verbose verbose mode
-histo Histogram corrected and uncorrected for pixeldimension
-min xmin Minimal value for histogram/volume/labels [DEFAULT masked_minval]
-max xmax Maximal value for histogram/volume/labels [DEFAULT masked_maxval]
-samp s Number of Samples for histogram/volume [DEFAULT xmax-xmin]
-threeSlice[C x,y,z] create three orthogonal views through the image center or the optionally supplied coordinate
-info print image info on standard out
-label labelfile give volume, mean intensity, standard deviation, min, max, quantiles for each label
-display display the results on the standard output (if -volumeSummary and/or -intensitySummary used, display theresults of these options)
-quantile [list of numbers separate by a coma] quantile value [DEFAULT: 1 5 33 50 66 95 99]
-maskForLabel maskForLabelfile binary mask
-probabilityMap probabilitymap use probability map to compute volume, mean intensity etc.
-volumeSummary give volume for each label
-fillEmpty provide feedback for all possible labels from min to max (see -min, -max)
-intensitySummary give mean intensity, standard deviation, min, max, quantiles for each label
-volOverlap labelFile compute Tanimoto (intersection over union), Dice coefficient and Hausdorff distance of input label image with additional image
Caution: option min/max currently only work for -label