How to read .img file in SimpleITK?

I have downloaded 4D CT data from DIRLAB image database. The images are in .img format.

I tried to read these images using sitk.ReadImage method.
sitk.ReadImage(image_file_name, sitk.sitkFloat32).
I am getting the following exception

Please tell me the correct process to read these images.

Hello @debapriya,

Not sure what format your image is in, it isn’t automatically recognized by ITK/SimpleITK.

Given the generic “img” extension I suspect this may be a raw format which requires additional information from a header file, but this is just a guess. A SimpleITK example illustrating how to read raw image files is available on read the docs.

If this is not the case you will need to provide additional information with respect to this format or possibly share an example image.

1 Like

Looking at the description of the DIRLAB data set, the images appear to be in Pinnacle TPS raw *.img format. It seems like the images are raw 16-bit images, although I don’t know the file format, so who knows?

https://med.emory.edu/departments/radiation-oncology/research-laboratories/deformable-image-registration/downloads-and-reference-data/index.html

Googling around it seems that the PyMedPhys library has a Pinnacle to DICOM export tool

https://docs.pymedphys.com/en/latest/users/ref/cli/pinnacle.html