user-forum > RE: mask files of each anatomical structure
Sep 13, 2022  05:09 PM | Eszter Agnes Papp
RE: mask files of each anatomical structure
Hi Yan,

Convert3D does not know, of course, where the left and right side of the brain is situated, but if you identify the voxel coordinates of the sagittal midline, you can define a subvolume to crop the image to using the -region command:
c3d WHS_SD_rat_atlas_v4.nii.gz -region 244x0x0vox 268x1024x512vox -o right-hemisphere.nii.gz

c3d WHS_SD_rat_atlas_v4.nii.gz -region 0x0x0vox 244x1024x512vox -o left-hemisphere.nii.gz

The above coordinates are my best estimate for the midline (see attached image for the cropping results - I tested this on the v3 atlas volume, but it works the same way for version 4, of course).

For details on the -region command, please see https://sourceforge.net/p/c3d/git/ci/master/tree/doc/c3d.md#-region-extract-region-from-image

While looking for this, I found an alternative command for splitting an image volume to individual labels, that may be of interest to you (may be faster if you need all regions):
https://sourceforge.net/p/c3d/git/ci/master/tree/doc/c3d.md#-split-split-multi-label-image-into-binary-images

All the best,
Eszter

Threaded View

TitleAuthorDate
ymmpi Sep 13, 2022
Eszter Agnes Papp Sep 13, 2022
ymmpi Sep 13, 2022
RE: mask files of each anatomical structure
Eszter Agnes Papp Sep 13, 2022