Hello all,
this is my first question in this forum please guide me
I am using ADNI images for my project of Alzheimer disease detection and classification using CNN but I have 3D images which need high performance GPU and Ultimate performance system so to avoid it I want to convert my each MRI nii
file into 2D slice (tiff or PNG) files How I will convert through 3D slicer please help me in this regard.
Thanks in advance.
I would recommend to convert from scientific (nifti, nrrd, …) to consumer file formats (png, tiff, …) as a temporary workaround (if you want to quickly try a network and don’t want to spend any time with formatting the input data).
To simply write out the native voxel values, you can do this:
pip_install("imageio")
import imageio
voxelArray = slicer.util.arrayFromVolume(myVolumeNode)
for i in range(len(outputLabelmapVolumeArray)):
imageio.imwrite(f'{outputDir}/image_{i:03}.tiff', outputLabelmapVolumeArray[i])
However, probably you would want to normalize the image size, resolution, maybe even intensity values.