STIR  6.2.0
Public Member Functions | Protected Member Functions | List of all members
stir::ITKImageInputFileFormat< STIRImageType > Class Template Reference

Class for reading images using ITK. More...

#include "stir/IO/ITKImageInputFileFormat.h"

Inheritance diagram for stir::ITKImageInputFileFormat< STIRImageType >:
Inheritance graph
[legend]

Public Member Functions

bool can_read (const FileSignature &signature, std::istream &input) const override
 This function always returns false as ITK cannot read from istream.
 
bool can_read (const FileSignature &signature, const std::string &filename) const override
 Use ITK reader to check if it can read the file (by seeing if it throws an exception or not)
 
const std::string get_name () const override
 

Protected Member Functions

bool actual_can_read (const FileSignature &signature, std::istream &input) const override
 
unique_ptr< STIRImageType > read_from_file (std::istream &input) const override
 This function always calls error() as ITK cannot read from istream.
 
unique_ptr< STIRImageType > read_from_file (const std::string &filename) const override
 This function uses ITK for reading and does the translation to STIR.
 

Additional Inherited Members

- Public Types inherited from stir::InputFileFormat< STIRImageType >
typedef STIRImageType data_type
 

Detailed Description

template<typename STIRImageType = DiscretisedDensity<3, float>>
class stir::ITKImageInputFileFormat< STIRImageType >

Class for reading images using ITK.

ITK (http://www.itk.org) has its own registry of file formats, so the current class provides an interface to that code. We use ITK for reading, and then translate the ITK data and meta-info to STIR.

ITK can read many file formats, see http://www.itk.org/Wiki/ITK/File_Formats for some info.

This STIR class has special handling for DICOM images. For many modalities, DICOM stores each slice in a different file. Normally, ITK reads only a single DICOM file, and hence a single slice. As this is not useful for STIR, we use itk::GDCMSeriesFileNames to find other slices belonging to the same series/time frame/gate as the input filename to read_from_file().

Warning
This translation currently ignores orientation and direction (e.g. of slice order).

The documentation for this class was generated from the following files: