help > VOI in mm cube?
Showing 1-9 of 9 posts
Display:
Results per page:
Apr 8, 2021  01:04 PM | alexpcg10
VOI in mm cube?
Hi all!

I'm new to this software and wondering how can I convert the value shown in VOI to mm cube or increasing the decimal place of cc?

So what I did is that I highlight the area interested> descriptive. But the brain that I used for is from animal, which has a small brain. 

The result that I got is 0.03cc but I would like to have more decimal place (or convert it into mm cube) to get a more accurate result. How can I do that?
 
Center of mass XYZ 73.23x28.50x5.63
VOI nvox(cc)=min/mean/max=SD: 1125 0.03 =11.1916 37.9018 59.0193 = 7.2466
VOI <>0 nvox(cc)=min/mean/max=SD: 1125 0.03 =11.1916 37.9018 59.0193 = 7.2466
VOI >0 nvox(cc)=min/mean/max=SD: 1125 0.03 =11.1916 37.9018 59.0193 = 7.2466


Many thanks in advanced!
Apr 8, 2021  02:04 PM | Chris Rorden
RE: VOI in mm cube?
If you are just starting out and have a modern computer, I would suggest you consider MRIcroGL not MRIcron. While I hope my legacy software is mature and useful, it does not leverage modern hardware and is not actively developed.

Note that you are given the volume as the discrete number of voxels (1125) as well as the cubic centimeters (0.03):

VOI nvox(cc)=min/mean/max=SD: 1125 0.03 =11.1916 37.9018 59.0193 = 7.2466

Therefore, you can get the precise volume knowing the spatial resolution of your image. This is reported in the header of your image, which you can see with the Window/Information menu item. Specifically, it will report the spacing (typically in millimeters) for the first three (spatial) dimensions I, J, K. This gives you the precise volume of each voxel, which you can multiply by the number of voxels.
Apr 9, 2021  02:04 AM | alexpcg10
RE: VOI in mm cube?
Hi Chris,

Thanks for the response. I'm actually calculate the infarct volume of the animal after inducing stroke.

Is there any video available showing how to calculate the precise volume?

I am a bit confused with what you have mentioned in the previous post, otherwise could you please show me the working on how can I get the precise volume?

So I used MRIcroGL for my analysis, and these are the value shown in the header of each images:
I1:-0.480432x-0.218863x4.35898mm (53x20x21)= 0.348061
I2:-0.429688x-0.192176x3.86228mm (53x20x20)= 0.6656362
I3:-0.378944x-0.165489x3.36558mm (53x20x19) = 0.250943
I4:-0.328199x -0.138802x 2.86888mm (53x20x18) = 0.320685
I5:-0.277455x -0.112115x 2.37218mm (53x20x17)= 0.194236
I6: -0.226711x-0.0854282x1.87548mm (53x20x16)=0.81149


And here is the descriptive of all the highlighted area from the images above:
Background image: 7_6_T2_20210324105011_70001
Drawing Center of mass XYZvox 102.17x38.28x14.58
Drawing Center of mass XYZmm 4.33x2.61x1.77
Background image: 7_6_T2_20210324105011_70001
Drawing VOI nvox(cc)=min/mean/max=SD: 6733 0.03 = 0.3754 10.6360 16.2363 = 2.0323
Drawing VOI <>0 nvox(cc)=min/mean/max=SD: 6733 0.03 = 0.3754 10.6360 16.2363 = 2.0323
Drawing VOI >0 nvox(cc)=min/mean/max=SD: 6733 0.03 = 0.3754 10.6360 16.2363 = 2.0323

Is this mean I will take -0.480432*-0.218863*4.35898mm * 6733 to get the VOI for image 1, -0.429688*-0.192176*3.86228mm * 6733 to get the VOI for image 2, and so on, then I add the total value together to get the VOI for the whole infarct volume?

Thanks in advance!
Apr 9, 2021  12:04 PM | Chris Rorden
RE: VOI in mm cube?
The distance between voxels centers in the row, column and slice directions is stored as pixdim[1], pixdim[2], pixdim[3] in the NIfTI header. Just make sure the image specifies NIFTI_UNITS_MM
  https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
I am surprised that you list negative values, as usually these are absolute values. Not sure which tool described these. You can also determine the voxel size from the s-form or q-form, where negative values would create a negative determinant (e.g. an image that is mirrored with respect to canonical space).

Your formula looks fine, though I would use absolute values for volume. 

If you have a lot of images, you would be better off writing a Matlab or Python script. MRIcroGL can save images as either .nii, .nii.gz or .voi format - in reality the .voi format is just a .nii.gz (with the extension telling the software to treat it as a discrete rather than continuous image). A script like this one 
https://github.com/rordenlab/spmScripts/...
could easily be modified to report volumes for hundreds of images with whatever precision you prefer.
Apr 11, 2021  10:04 AM | alexpcg10
RE: VOI in mm cube?
Hi Chris,

Sorry to be bothersome.

I'm really catch no ball how to get the precise volume. Is there any easy way for you to show me how to do that? I'm not good at using python script so thinking of doing the calculation manually. MRIcron or MRIcroGL both downloaded so either is fine.

Thanks in advance and really appreciate if you can guide me a simple calculation for that?
Apr 11, 2021  01:04 PM | Chris Rorden
RE: VOI in mm cube?
The volume is the product of the number of voxels and the voxel spacing.
 
For example, in the screenshot below the voxel spacing is 1.875*1.875*9mm, so each voxel is 31.640625mm^3
Attachment: spacing.png
May 29, 2022  07:05 PM | tammartru
RE: VOI in mm cube?
Dear MriCron expert!
Flowing the suggested script for calculating images volume (https://github.com/rordenlab/spmScripts/...)
I am not sure it is the right script, because it seems to only calculate number of Nan voxels.
Could you please direct me to the script calculating ROIs volumes?

Thank you very much!
Tammar

Originally posted by Chris Rorden:
The distance between voxels centers in the row, column and slice directions is stored as pixdim[1], pixdim[2], pixdim[3] in the NIfTI header. Just make sure the image specifies NIFTI_UNITS_MM
  https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
I am surprised that you list negative values, as usually these are absolute values. Not sure which tool described these. You can also determine the voxel size from the s-form or q-form, where negative values would create a negative determinant (e.g. an image that is mirrored with respect to canonical space).

Your formula looks fine, though I would use absolute values for volume. 

If you have a lot of images, you would be better off writing a Matlab or Python script. MRIcroGL can save images as either .nii, .nii.gz or .voi format - in reality the .voi format is just a .nii.gz (with the extension telling the software to treat it as a discrete rather than continuous image). A script like this one 
https://github.com/rordenlab/spmScripts/...
could easily be modified to report volumes for hundreds of images with whatever precision you prefer.
May 30, 2022  10:05 AM | Chris Rorden
RE: VOI in mm cube?
The script reports the number of voxels, just multiple by the volume of each voxel (in cubic millimeters) to get the volume in that unit:
  hdr = spm_create_vol(filename);
  mm3=prod(abs(hdr.mat(1:3, 1:3)*[1;1;1]));
You may find other scripts in that repository useful, for example to find mean and standard deviation:
  https://github.com/rordenlab/spmScripts/...
May 31, 2022  06:05 AM | tammartru
RE: VOI in mm cube?
Thank you very much Mr. Rorden

With your permission, some following questions:
1. The space between voxels is not included when measuring volume, or given volume of each voxel includes spacing?
I have seen in previous posts that to get volume in cubic mm, spacing of the three dimensions should be multiplied by number of voxels.

2. My VOIs (lesion maps) and the background image (MNI) have different resolutions (voxel sizes and dimensions). 
Trying overlay the same VOI on two different resolution backgrounds, I see that it affects nvox but not volume in cc.
Does is make sense? Should I first coreg:reslice my VOIs to the background image dimension? 


Cheers!
Tammar