kitwaremedical / itkioscanco Goto Github PK
View Code? Open in Web Editor NEWITK Image IO for Scanco MicroCT .ISQ files
Home Page: https://itk-io-scanco-app.on.fleek.co/
License: Apache License 2.0
ITK Image IO for Scanco MicroCT .ISQ files
Home Page: https://itk-io-scanco-app.on.fleek.co/
License: Apache License 2.0
Hi,
i noticed that when opening an .ISQ file and then writing it as an .ISQ file, parts of the metadata seem to get deleted, or changed.
It seems to be affecting the CalibrationData, CreationDate, ModificationDate, MuScaling, MuWater, RescaleIntercept, RescaleSlope, RescaleType and RescaleUnits.
Here is an example of the code:
import itk
image=itk.imread('original_file.ISQ')
print(dict(image))
itk.imwrite(image,'saved_file.ISQ')
image_saved=itk.imread('saved_file.ISQ')
print(dict(image_saved))
Output for the original file:
{'CalibrationData': '60 kVp, BH: 200 mg HA/ccm, Scaling 8192', 'CreationDate': '14-JUN-2021 13:27:50.972', 'DataRange': (-5135.0, 11000.0), 'Energy': 59.4, 'Intensity': 0.9, 'MeasurementIndex': 24945, 'ModificationDate': '14-JUN-2021 13:27:50.972', 'MuScaling': 8192.0, 'MuWater': 0.2402999997138977, 'NumberOfProjections': 750, 'NumberOfSamples': 1536, 'PatientIndex': 3453, 'PatientName': 'Anonymous', 'ReconstructionAlg': 3, 'ReferenceLine': 0.0, 'RescaleIntercept': -1000.0, 'RescaleSlope': 0.5079913135469725, 'RescaleType': 2, 'RescaleUnits': 'mg HA/ccm', 'SampleTime': 100.0, 'ScanDistance': 125.952, 'ScannerID': 3333, 'ScannerType': 9, 'Site': 39, 'SliceIncrement': 0.08199999999999999, 'SliceThickness': 0.08199999999999999, 'Version': 'CTDATA-HEADER_V1', 'origin': array([0., 0., 0.]), 'spacing': array([0.082, 0.082, 0.082]), 'direction': array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}
Output for the written file:
{'CalibrationData':` '', 'CreationDate': '6-DEC-1911 13:07:54.671', 'DataRange': (-5135.0, 11000.0), 'Energy': 59.4, 'Intensity': 0.9, 'MeasurementIndex': 24945, 'ModificationDate': '6-DEC-1911 13:07:54.671', 'MuScaling': 1.0, 'MuWater': 0.7032999992370605, 'NumberOfProjections': 750, 'NumberOfSamples': 1536, 'PatientIndex': 3453, 'PatientName': 'Anonymous', 'ReconstructionAlg': 3, 'ReferenceLine': 0.0, 'RescaleIntercept': 0.0, 'RescaleSlope': 1.0, 'RescaleType': 0, 'RescaleUnits': '', 'SampleTime': 100.0, 'ScanDistance': 125.952, 'ScannerID': 3333, 'ScannerType': 9, 'Site': 39, 'SliceIncrement': 0.08199999999999999, 'SliceThickness': 0.08199999999999999, 'Version': 'CTDATA-HEADER_V1', 'origin': array([0., 0., 0.]), 'spacing': array([0.082, 0.082, 0.082]), 'direction': array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}
Is there maybe a solution for this?
Thanks for any help in advance and thanks for providing this tool!
Hello,
I attempted to use ITKIOScanco to open segmentation masks in *.AIM format. These only contain two values, 0 and 1, and are encoded in signed char (afaik). On trying to open, I received the following error (full stack trace attached below):
TemplateTypeError: itk.Image is not wrapped for input type
itk.SC, int
.
After some digging, I found a possible solution would be to set the ComponentType
, as follows:
itk.ScancoImageIO.New(ComponentType=itk.CommonEnums.IOComponent_SHORT)
however, this change is not passed through, and I still receive the same error. Finally, I was able to mitigate the error by editing _io_component_type_dict
in the file itk/support/template_class.py
on Line 179 to read
"char": itk.SS,
Formerly, this line read
"char": itk.SC,
which fixed the above mentioned error, but I do not find this solution satisfactory. Unfortunately, I do not have full debugging capabilities on my setup (using Jupyter), so I am unable to follow up where exactly the ComponentType
is overwritten, however I can verify that after calling itk.imread()
, the property is set back to char
, even if I explicitly set it to short
before.
Any suggestions or help with this issue are strongly appreciated, as I would prefer a "clean" solution to this problem.
For reference, I am using Anaconda3 on Ubuntu 22.04.1 LTS. The installed library versions are
itk 5.2.1.post1
itk-bonemorphometry 1.3.0
itk-core 5.2.1.post1
itk-filtering 5.2.0
itk-io 5.2.1.post1
itk-ioscanco 0.9.2
itk-meshtopolydata 0.8.1
itk-numerics 5.2.1.post1
itk-registration 5.2.1.post1
itk-segmentation 5.2.1.post1
itk-texturefeatures 3.5.1
Sample files and code examples can be submitted on request.
Full stacktrace: stacktrace_itkioscanco.txt
Thank you, and keep up the good work!
Best regards,
Johannes
PS: I use ITKIOScanco regularly to read SCANCO *.AIM volume files in Python, and it works exactly as expected. The problem only occurs with segmentation masks, which are generated from GOBJ-files and often referred to as *seg.aim
-files by SCANCO.
Currently, the reader does not do conversion to HU. We should enabled that by default.
Hallo everyone,
i am trying to install itk-ioscanco in order to read ISQ image, I have python 3.9 and tried to install ioscanco through
python3 -m pip install itk-ioscanco
but I always get this error:
ERROR: Could not find a version that satisfies the requirement itk-ioscanco (from versions: none)
ERROR: No matching distribution found for itk-ioscanco
can anyone help with this thank you!
Currently we only support reading metadata. We should also support writing it.
Hi,
Saw that you wrapped the module to python,
tried to test it crashes at call :
conda create --name itk python=3.5
conda activate itk
conda install numpy pip ipython
pip install itk itk-ioscanco
ipython
import itk
reader = itk.ScancoImageIO.New()
then it crashes IPython without any warning :(
Hi,
Is there a function that reads and returns the header of .isq files?
Thanks!
Serena
I have a problem converting loaded AIMs to density
after reading an aim file (XCT 1), the image data is in hounsfield units. I seem to be missing the density intercept and density slope. Is there any way these can be added to the meta data? Thank you for your help!
{'CalibrationData': '60kVp, BH: 200 mg HA/ccm, Scaling 8192',
'CreationDate': 'XXXXXX', #blinded
'DataRange': (-1314.0, 10451.0),
'Energy': 59.4,
'Intensity': 0.9,
'MeasurementIndex': 0000, #blinded
'ModificationDate': 'XXXXX', #blinded
'MuScaling': 8192.0,
'MuWater': 0.2415,
'NumberOfProjections': 750,
'NumberOfSamples': 1536,
'PatientIndex': 0000, #blinded
'PatientName': 'XXXXXX', #blinded
'ReconstructionAlg': 3,
'ReferenceLine': 0.0,
'RescaleIntercept': -1000.0,
'RescaleSlope': 0.505467132505176,
'RescaleType': 2,
'RescaleUnits': 'mg HA/ccm',
'SampleTime': 100.0,
'ScanDistance': 125.952,
'ScannerID': 3330,
'ScannerType': 9,
'Site': 20,
'SliceIncrement': 0.0820000022649765,
'SliceThickness': 0.0820000022649765,
'Version': 'AIMDATA_V020 ',
'origin': array([ 0. , 51.65999985, 46.49399948]),
'spacing': array([0.082, 0.082, 0.082]),
'direction': array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}
CMake Error at /Shared/sinapse/opt/iiai/apps/cmake/3.15.0/share/cmake-3.15/Modules/ExternalData.cmake:1121 (message):
Object
SHA512=9f03a48869d8b4ced44927a273f95f4d9985a644206145ff6580892242a42081c51865013cfc490c011a7a765dcf6764d98bee92da718829faa177e5540de211
not found at:
https://insightsoftwareconsortium.github.io/ITKTestingData/SHA512/9f03a48869d8b4ced44927a273f95f4d9985a644206145ff6580892242a42081c51865013cfc490c011a7a765dcf6764d98bee92da718829faa177e5540de211 ("HTTP response code said error")
https://data.kitware.com:443/api/v1/file/hashsum/SHA512/9f03a48869d8b4ced44927a273f95f4d9985a644206145ff6580892242a42081c51865013cfc490c011a7a765dcf6764d98bee92da718829faa177e5540de211/download ("Timeout was reached")
https://itk.org/files/ExternalData/SHA512/9f03a48869d8b4ced44927a273f95f4d9985a644206145ff6580892242a42081c51865013cfc490c011a7a765dcf6764d98bee92da718829faa177e5540de211 ("HTTP response code said error")
https://slicer.kitware.com/midas3/api/rest?method=midas.bitstream.download&checksum=9f03a48869d8b4ced44927a273f95f4d9985a644206145ff6580892242a42081c51865013cfc490c011a7a765dcf6764d98bee92da718829faa177e5540de211&algorithm=SHA512 (wrong hash SHA512=639526ba1271b833beeb026311a3d40d2b50b8480ce8e938e87ea0dfc9c84e76867be09043f9b15fc5b21d003580c6169f1ba59b2202686b80258d8993ab7a09)
When reading contours generated by Scanco (*.AIM) the following error is prompted:
TemplateTypeError: itk.Image is not wrapped for input type
itk.SC, int.
Would it be possible to cast these images to a different type? They typically only contain a binary classification for the trabecular/cortical contours.
Currently, rescaling is done only if input image is not compressed:
ITKIOScanco/src/itkScancoImageIO.cxx
Lines 1126 to 1162 in a913b87
delete[] input;
(currently on line 1294).A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.