STIR 6.4.0
stir::ITKImageInputFileFormat< STIRImageType > Class Template Reference

Class for reading images using ITK. More...

#include "stir/IO/ITKImageInputFileFormat.h"

Inheritance diagram for stir::ITKImageInputFileFormat< STIRImageType >:

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< DataT >
typedef DataT 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).

Member Function Documentation

◆ can_read() [1/2]

template<typename STIRImageType>
bool stir::ITKImageInputFileFormat< STIRImageType >::can_read ( const FileSignature & signature,
std::istream & input ) const
overridevirtual

This function always returns false as ITK cannot read from istream.

Reimplemented from stir::InputFileFormat< DataT >.

References can_read().

Referenced by can_read(), and can_read().

◆ can_read() [2/2]

template<typename STIRImageType>
bool stir::ITKImageInputFileFormat< STIRImageType >::can_read ( const FileSignature & signature,
const std::string & filename ) const
overridevirtual

Use ITK reader to check if it can read the file (by seeing if it throws an exception or not)

Reimplemented from stir::InputFileFormat< DataT >.

References can_read().

◆ get_name()

template<typename STIRImageType = DiscretisedDensity<3, float>>
const std::string stir::ITKImageInputFileFormat< STIRImageType >::get_name ( ) const
inlineoverridevirtual

◆ actual_can_read()

template<typename STIRImageType>
bool stir::ITKImageInputFileFormat< STIRImageType >::actual_can_read ( const FileSignature & signature,
std::istream & input ) const
overrideprotectedvirtual

◆ read_from_file() [1/2]

template<typename STIRImageType>
unique_ptr< STIRImageType > stir::ITKImageInputFileFormat< STIRImageType >::read_from_file ( std::istream & input) const
overrideprotectedvirtual

This function always calls error() as ITK cannot read from istream.

Implements stir::InputFileFormat< DataT >.

References stir::error(), and read_from_file().

Referenced by read_from_file(), and read_from_file().

◆ read_from_file() [2/2]

template<typename STIRImageType>
unique_ptr< STIRImageType > stir::ITKImageInputFileFormat< STIRImageType >::read_from_file ( const std::string & filename) const
overrideprotectedvirtual

This function uses ITK for reading and does the translation to STIR.

Reimplemented from stir::InputFileFormat< DataT >.

References read_from_file().


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