Loading...
Searching...
No Matches
itk::MevisDicomTiffImageIO Class Reference

`#include <itkMevisDicomTiffImageIO.h>`

## Detailed Description

ImageIO for handling Mevis dcm/tiff images,

- first public version (no 4D support) developed using gdcm 2.0.10, tiff 3.8.2 and itk 3.10.0

NOTES:

- It is good to realize that ITK images have some properties like spacing and orientatin defined only for the dimensionality of the image, e.g. 2D slices does not have 3D vector sizes of origin/spacing etc., while dicom may have these defined. The other way around, 4D information are not stored in the dicom file, e.g. origin[3] will be lost when writing. When reading we use default values for origin (=0) and spacing (=1). Another important issue is the direction matrix, dicom only stores x/y vectors, and calculates the third one using outer vector product (assuming right-hand coordinate system).
- tiff image is always 2D or 3D
- IMPORTANT: tiff has been designed for max 32 bits addressable memory block, the use of 64 bits has been specified in bigtiff.org, and is supported from libtiff version 4.0 and above. Unfortunately, ML does not support bigtiff, and probably will not in the future. Therefore, this class remain as is as long ML will not upgrade, only bug fixes will be considered
- IMPORTANT: 4d information is lost in the writing of the dicom files! This severely limits the use of this format in the future. Default values for 4D spacing is set at 1.0 and for origin at 0.0 (when reading)

PROPERTIES:

- 2D/3D/4D, scalar types supported
- input/output tiff image expected to be tiled
- types supported uchar, char, ushort, short, uint, int, and float (double is not accepted by MevisLab)
- writing defaults is tiled tiff, tilesize is 128, 128, LZW compression and cm metric system
- default extension for tiff-image is ".tif" to comply with mevislab standards
- gdcm header during reading is stored as (global) metadata to fill in the gdcm header when writing. All 'image' values, eg voxelsize, dimensions etc are overwritten, except min/max value of the image and intercept/slope.
- note: when reading and writing dcm/tiff 2D files, the third dimension of spacing and origin are replaced with default values! In MevisLab these vars are contained.
- BUG in ML: the x/y spacing of the tiff file is swapped with respect to the x/y spacing in dcm file (dcm info is used btw)

todo

- implementing writing tiffimages if x,y < 16 (tilesize)
- adding gantry tilt to test data!
- replacing messages using itkExceptions

20 Feb 2009 bugfixed; always set the pixeltype of the dcm image to unsigned short when writing, otherwise the origin is not read in correctly by mevislab (for int, float, double) 30 sep 2009 bugfix: consistent handling of 2d/3d throughout code, thanks to Stefan Klein for pointing out of this bug which revealed after usage on 2d on windows and thanks for his suggestions to fix this. 11 dec 2010 added 4d support, note tiff image is always 2D or 3D 18 apr 2011 added reading dicom tags from sequences of tags, suggestion and code proposal by Reinhard Hameeteman

email: rashi.nosp@m.ndra.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition at line 109 of file itkMevisDicomTiffImageIO.h.

Inheritance diagram for itk::MevisDicomTiffImageIO:
[legend]

## Public Types

using | Pointer = SmartPointer<Self>
using | Self = MevisDicomTiffImageIO
using | Superclass = ImageIOBase

## Public Member Functions

virtual bool | CanReadFile (const char *)
virtual bool | CanStreamRead ()
virtual bool | CanStreamWrite ()
virtual bool | CanWriteFile (const char *)
virtual const char * | GetClassName () const
virtual double | GetGantryTilt () const
virtual double | GetRescaleIntercept () const
virtual double | GetRescaleSlope () const
virtual void | Read (void *buffer)
virtual void | ReadImageInformation ()
virtual void | Write (const void *buffer)
virtual void | WriteImageInformation ()

## Static Public Member Functions

static Pointer | New ()

## Protected Member Functions

| MevisDicomTiffImageIO ()
void | PrintSelf (std::ostream &os, Indent indent) const
| ~MevisDicomTiffImageIO ()

## Private Member Functions

bool | FindElement (const gdcm::DataSet ds, const gdcm::Tag tag, gdcm::DataElement &de, const bool breadthfirstsearch)
| MevisDicomTiffImageIO (const Self &)
void | operator= (const Self &)

## Private Attributes

unsigned int | m_BitsPerSample {}
unsigned short | m_Compression {}
std::string | m_DcmFileName {}
unsigned int | m_Depth {}
double | m_EstimatedMaximum {}
double | m_EstimatedMinimum {}
double | m_GantryTilt {}
bool | m_IsOpen {}
bool | m_IsTiled {}
unsigned int | m_Length {}
unsigned short | m_NumberOfTiles {}
double | m_RescaleIntercept {}
double | m_RescaleSlope {}
unsigned int | m_TIFFDimension {}
std::string | m_TiffFileName {}
TIFF * | m_TIFFImage {}
unsigned int | m_TileDepth {}
unsigned int | m_TileLength {}
unsigned int | m_TileWidth {}
unsigned int | m_Width {}

## Member Typedef Documentation

## Pointer

using itk::MevisDicomTiffImageIO::Pointer = SmartPointer<Self>

Definition at line 114 of file itkMevisDicomTiffImageIO.h.

## Self

using itk::MevisDicomTiffImageIO::Self = MevisDicomTiffImageIO

Definition at line 112 of file itkMevisDicomTiffImageIO.h.

## Superclass

using itk::MevisDicomTiffImageIO::Superclass = ImageIOBase

Definition at line 113 of file itkMevisDicomTiffImageIO.h.

## Constructor & Destructor Documentation

## MevisDicomTiffImageIO() [1/2]

itk::MevisDicomTiffImageIO::MevisDicomTiffImageIO | ( |  | ) |

protected

## ~MevisDicomTiffImageIO()

itk::MevisDicomTiffImageIO::~MevisDicomTiffImageIO | ( |  | ) |

protected

## MevisDicomTiffImageIO() [2/2]

itk::MevisDicomTiffImageIO::MevisDicomTiffImageIO | ( | const Self & |  | ) |

private

## Member Function Documentation

## CanReadFile()

virtual bool itk::MevisDicomTiffImageIO::CanReadFile | ( | const char * |  | ) |

virtual

## CanStreamRead()

virtual bool itk::MevisDicomTiffImageIO::CanStreamRead | ( |  | ) |

inline virtual

Definition at line 141 of file itkMevisDicomTiffImageIO.h.

## CanStreamWrite()

virtual bool itk::MevisDicomTiffImageIO::CanStreamWrite | ( |  | ) |

inline virtual

Definition at line 148 of file itkMevisDicomTiffImageIO.h.

## CanWriteFile()

virtual bool itk::MevisDicomTiffImageIO::CanWriteFile | ( | const char * |  | ) |

virtual

## FindElement()

bool itk::MevisDicomTiffImageIO::FindElement | ( | const gdcm::DataSet | ds,
|  | const gdcm::Tag | tag,
|  | gdcm::DataElement & | de,
|  | const bool | breadthfirstsearch )

private

## GetClassName()

virtual const char * itk::MevisDicomTiffImageIO::GetClassName | ( |  | ) | const

virtual

## GetGantryTilt()

virtual double itk::MevisDicomTiffImageIO::GetGantryTilt | ( |  | ) | const

virtual

## GetRescaleIntercept()

virtual double itk::MevisDicomTiffImageIO::GetRescaleIntercept | ( |  | ) | const

virtual

## GetRescaleSlope()

virtual double itk::MevisDicomTiffImageIO::GetRescaleSlope | ( |  | ) | const

virtual

## New()

Pointer itk::MevisDicomTiffImageIO::New | ( |  | ) |

static

## operator=()

void itk::MevisDicomTiffImageIO::operator= | ( | const Self & |  | ) |

private

## PrintSelf()

void itk::MevisDicomTiffImageIO::PrintSelf | ( | std::ostream & | os,
|  | Indent | indent ) const

protected

## Read()

virtual void itk::MevisDicomTiffImageIO::Read | ( | void * | buffer | ) |

virtual

## ReadImageInformation()

virtual void itk::MevisDicomTiffImageIO::ReadImageInformation | ( |  | ) |

virtual

## Write()

virtual void itk::MevisDicomTiffImageIO::Write | ( | const void * | buffer | ) |

virtual

## WriteImageInformation()

virtual void itk::MevisDicomTiffImageIO::WriteImageInformation | ( |  | ) |

virtual

## Field Documentation

## m_BitsPerSample

unsigned int itk::MevisDicomTiffImageIO::m_BitsPerSample {}

private

Definition at line 176 of file itkMevisDicomTiffImageIO.h.

## m_Compression

unsigned short itk::MevisDicomTiffImageIO::m_Compression {}

private

Definition at line 175 of file itkMevisDicomTiffImageIO.h.

## m_DcmFileName

std::string itk::MevisDicomTiffImageIO::m_DcmFileName {}

private

Definition at line 169 of file itkMevisDicomTiffImageIO.h.

## m_Depth

unsigned int itk::MevisDicomTiffImageIO::m_Depth {}

private

Definition at line 179 of file itkMevisDicomTiffImageIO.h.

## m_EstimatedMaximum

double itk::MevisDicomTiffImageIO::m_EstimatedMaximum {}

private

Definition at line 190 of file itkMevisDicomTiffImageIO.h.

## m_EstimatedMinimum

double itk::MevisDicomTiffImageIO::m_EstimatedMinimum {}

private

Definition at line 189 of file itkMevisDicomTiffImageIO.h.

## m_GantryTilt

double itk::MevisDicomTiffImageIO::m_GantryTilt {}

private

Definition at line 188 of file itkMevisDicomTiffImageIO.h.

## m_IsOpen

bool itk::MevisDicomTiffImageIO::m_IsOpen {}

private

Definition at line 174 of file itkMevisDicomTiffImageIO.h.

## m_IsTiled

bool itk::MevisDicomTiffImageIO::m_IsTiled {}

private

Definition at line 180 of file itkMevisDicomTiffImageIO.h.

## m_Length

unsigned int itk::MevisDicomTiffImageIO::m_Length {}

private

Definition at line 178 of file itkMevisDicomTiffImageIO.h.

## m_NumberOfTiles

unsigned short itk::MevisDicomTiffImageIO::m_NumberOfTiles {}

private

Definition at line 184 of file itkMevisDicomTiffImageIO.h.

## m_RescaleIntercept

double itk::MevisDicomTiffImageIO::m_RescaleIntercept {}

private

Definition at line 187 of file itkMevisDicomTiffImageIO.h.

## m_RescaleSlope

double itk::MevisDicomTiffImageIO::m_RescaleSlope {}

private

Definition at line 186 of file itkMevisDicomTiffImageIO.h.

## m_TIFFDimension

unsigned int itk::MevisDicomTiffImageIO::m_TIFFDimension {}

private

Definition at line 173 of file itkMevisDicomTiffImageIO.h.

## m_TiffFileName

std::string itk::MevisDicomTiffImageIO::m_TiffFileName {}

private

Definition at line 170 of file itkMevisDicomTiffImageIO.h.

## m_TIFFImage

TIFF* itk::MevisDicomTiffImageIO::m_TIFFImage {}

private

Definition at line 172 of file itkMevisDicomTiffImageIO.h.

## m_TileDepth

unsigned int itk::MevisDicomTiffImageIO::m_TileDepth {}

private

Definition at line 183 of file itkMevisDicomTiffImageIO.h.

## m_TileLength

unsigned int itk::MevisDicomTiffImageIO::m_TileLength {}

private

Definition at line 182 of file itkMevisDicomTiffImageIO.h.

## m_TileWidth

unsigned int itk::MevisDicomTiffImageIO::m_TileWidth {}

private

Definition at line 181 of file itkMevisDicomTiffImageIO.h.

## m_Width

unsigned int itk::MevisDicomTiffImageIO::m_Width {}

private

Definition at line 177 of file itkMevisDicomTiffImageIO.h.

Generated on 1768596610 for elastix by 1.15.0 |