Given a bunch of 2D frames in a temporal series, what is the intended way in ITK to write those out to be recognised as 2D + t image, not just as 3D image?
I’m asking because ITK-Snap or Slicer display 3D DICOM images (written out this way, naturally, ) as single time-step image. This is from converting VFSS .avi to DICOM for analysis, which is not ideal.
What is the most straightforward intended way and, specifically, format to preserve temporal series semantics (preferably without having to fiddle with DICOM tags)?
If you use NRRD file format then you can specify the kind of each axis. For example:
kinds: domain domain domain: 3D image
kinds: time domain domain: 2D+t image
In 3D Slicer, we recognize many 2D time sequence image acquisitions, such as fluoroscopy, ultrasound, cine-MRI. Therefore, VFSS is loaded as a time sequence (when it is loaded properly with the DICOM module). If you experience a different behavior in the latest Slicer version then let me know.
I’ve had a quick look at itk::NrrdImageIO, but I’m unclear how/where to specify the kind of each axis, when writing NRRD (.nhdr). Or, does it have to be passed to NrrdImageIO via itk::MetaDataDictionary? I can’t find a working example to set those axis kinds.
Would you be able to point me to an example, perhaps, in Python?
PS. With our stand-alone GE Fluorostar we can’t get DICOM export to work correctly, and GE support are dragging their feet with addressing the issue with this unit. So, at this stage I’m forced to export AVIs, and then convert those to something suitable for analysis. Not ideal, but kinda have to play along at this stage,
I’ve followed, and now the header comes out like this, where kinds appears as a field, and as a key/value pair, which doesn’t look right — something is rotten in the state of Denmark:
NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: unsigned char
dimension: 3
space: left-posterior-superior
sizes: 1024 1280 13
space directions: (1,0,0) (0,1,0) (0,0,1)
kinds: domain domain domain
encoding: raw
space origin: (0,0,0)
kinds:=time domain domain
In 3D Slicer everything is in 3D. If you have a 2D image slice then we want to be able to put it anywhere at any orientation. Therefore, regardless if the image has one or more slices, it must to have 3 dimensional domain and so the header should contain kinds: domain domain domain time and all spatial positions and directions should have 3 components.
You can go to Sample Data module, download the cardiac CT time sequence image, save it, and have a look at the header. Or you can create a 4D sequence using this Python script.