I am trying to read some light microscopy images. So I compiled SimpleITK with the SCIFIO module:
cmake -DModule_SCIFIO:BOOL=ON -G Ninja ~/src/SimpleITK/Superbuild
Then I did the following:
import SimpleITK as sitk
reader = sitk.ImageFileReader()
reader.SetFileName("my_file.ims")
reader.ReadImageInformation()
print reader
Which displayed:
itk::simple::ImageFileReader
FileName: "HTA 23 Panel 1 ON Lyve-1 570 CD8 421 CD4 510 Coll IV 700 Foxp3 488 CD31 594 CD3 647 Comp.ims"
Image Information:
PixelType: 8-bit unsigned integer
Dimension: 5
NumberOfComponents: 1
Direction: [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]
Origin: [ 0, 0, 0, 0, 0 ]
Spacing: [ 0.00037851, 0.000378491, 0.000999928, 1, 1 ]
Size: [ 4093, 5116, 26, 1, 8 ]
OutputPixelType: Unknown pixel id
LoadPrivateTags: 0
Registered ImageIO:
BMPImageIO ( *.bmp, *.BMP )
BioRadImageIO ( *.PIC, *.pic )
GDCMImageIO
GE4ImageIO
GE5ImageIO
GiplImageIO
JPEGImageIO ( *.jpg, *.JPG, *.jpeg, *.JPEG )
MetaImageIO ( *.mha, *.mhd )
NiftiImageIO ( *.nia, *.nii, *.nii.gz, *.hdr, *.img, *.img.gz )
NrrdImageIO ( *.nrrd, *.nhdr )
PNGImageIO ( *.png, *.PNG )
SCIFIOImageIO
StimulateImageIO
TIFFImageIO ( *.tif, *.TIF, *.tiff, *.TIFF )
VTKImageIO ( *.vtk )
Debug: 0
NumberOfThreads: 16
Commands: (none)
ProgressMeasurement: 0
ActiveProcess: (none)
This image is reported as a 5-D one component/channel image with size: [ 4093, 5116, 26, 1, 8 ]
SimpleITK does not handle 5-D images so I can’t actually read it. This image to me is a 3-D image with 8 channels. Even ITK proper would have problems reading this image as a VectorImage
. The only way to read it in ITK would be to read it into a 5-D scalar image, then use the ExatractImageFilter to get the something like [:,:,:,1,C]
(python slice notation), the recompose the channels.
How are others dealing with reading multi-channel images from SCIFIO.