Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitk::RawImageFileReader Class Reference

Reader to read raw image files. More...

#include <mitkRawImageFileReader.h>

Inheritance diagram for mitk::RawImageFileReader:
Collaboration diagram for mitk::RawImageFileReader:

Public Types

enum  IOPixelType {
  UCHAR, SCHAR, USHORT, SSHORT,
  UINT, SINT, FLOAT, DOUBLE
}
 
enum  EndianityType { LITTLE, BIG }
 
- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- Public Types inherited from mitk::FileReader
typedef FileReader Self
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

 mitkClassMacro (RawImageFileReader, FileReader)
 
Pointer Clone () const
 
virtual void SetFileName (std::string _arg)
 
virtual void SetFileName (const char *_arg)
 Specify the file to load. More...
 
virtual std::string GetFileName ()
 
virtual const char * GetFileName () const
 
virtual void SetFilePrefix (std::string _arg)
 
virtual void SetFilePrefix (const char *_arg)
 Specify file prefix for the file(s) to load. More...
 
virtual std::string GetFilePrefix ()
 
virtual const char * GetFilePrefix () const
 Get the specified file prefix for the file(s) to load. More...
 
virtual void SetFilePattern (std::string _arg)
 
virtual void SetFilePattern (const char *_arg)
 Specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number. More...
 
virtual std::string GetFilePattern ()
 
virtual const char * GetFilePattern () const
 Get the specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number. More...
 
virtual void SetPixelType (IOPixelType _arg)
 
virtual void SetEndianity (EndianityType _arg)
 
virtual void SetDimensionality (int _arg)
 
virtual int GetDimensionality ()
 
void SetDimensions (unsigned int i, unsigned int dim)
 
unsigned int GetDimensions (unsigned int i) const
 
- Public Member Functions inherited from mitk::ImageSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 
- Public Member Functions inherited from mitk::FileReader
virtual std::vector< std::string > GetClassHierarchy () const
 
 itkTypeMacroNoParent (FileReader) virtual const char *GetFileName() const =0
 Get the specified the file to load. More...
 
virtual bool CanReadFromMemory ()
 Specifies, whether the file reader also can read a file from a memory buffer. More...
 
virtual void SetReadFromMemory (bool read)
 Set/Get functions to advise the file reader to use a memory array for reading a file. More...
 
virtual bool GetReadFromMemory ()
 
virtual void SetMemoryBuffer (const char *dataArray, unsigned int size)
 To be used along with a call of SetReadFromMemory(true). This sets the memory buffer and the size from which the reader will read. More...
 

Static Public Member Functions

static Pointer New ()
 
static bool CanReadFile (const std::string filename, const std::string filePrefix, const std::string filePattern)
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::FileReader
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 RawImageFileReader ()
 
 ~RawImageFileReader () override
 
void GenerateData () override
 
template<typename TPixel , unsigned int VImageDimensions>
void TypedGenerateData ()
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
 ~ImageSource () override
 
void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 
- Protected Member Functions inherited from mitk::FileReader
 FileReader ()
 
virtual ~FileReader ()
 

Protected Attributes

std::string m_FileName
 
std::string m_FilePrefix
 
std::string m_FilePattern
 
IOPixelType m_PixelType
 
int m_Dimensionality
 
EndianityType m_Endianity
 
itk::Vector< int, 3 > m_Dimensions
 
- Protected Attributes inherited from mitk::FileReader
bool m_CanReadFromMemory
 
bool m_ReadFromMemory
 
const char * m_MemoryBuffer
 
unsigned int m_MemorySize
 

Additional Inherited Members

- Static Protected Member Functions inherited from mitk::ImageSource
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Reader to read raw image files.

The user must set the dimensionality, the dimensions and the pixel type. If they are incorrect, the image will not be opened or the visualization will be incorrect.

Definition at line 28 of file LegacyIO/mitkRawImageFileReader.h.

Member Enumeration Documentation

◆ EndianityType

Endianity of bits.

Enumerator
LITTLE 
BIG 

Definition at line 56 of file LegacyIO/mitkRawImageFileReader.h.

◆ IOPixelType

Supported pixel types.

Enumerator
UCHAR 
SCHAR 
USHORT 
SSHORT 
UINT 
SINT 
FLOAT 
DOUBLE 

Definition at line 52 of file LegacyIO/mitkRawImageFileReader.h.

Constructor & Destructor Documentation

◆ RawImageFileReader()

mitk::RawImageFileReader::RawImageFileReader ( )
protected

◆ ~RawImageFileReader()

mitk::RawImageFileReader::~RawImageFileReader ( )
overrideprotected

Member Function Documentation

◆ CanReadFile()

static bool mitk::RawImageFileReader::CanReadFile ( const std::string  filename,
const std::string  filePrefix,
const std::string  filePattern 
)
static

◆ Clone()

Pointer mitk::RawImageFileReader::Clone ( ) const

◆ GenerateData()

void mitk::RawImageFileReader::GenerateData ( )
overrideprotected

◆ GetDimensionality()

virtual int mitk::RawImageFileReader::GetDimensionality ( )
virtual

◆ GetDimensions()

unsigned int mitk::RawImageFileReader::GetDimensions ( unsigned int  i) const

◆ GetFileName() [1/2]

virtual std::string mitk::RawImageFileReader::GetFileName ( )
virtual

◆ GetFileName() [2/2]

virtual const char* mitk::RawImageFileReader::GetFileName ( ) const
virtual

◆ GetFilePattern() [1/2]

virtual std::string mitk::RawImageFileReader::GetFilePattern ( )
virtual

◆ GetFilePattern() [2/2]

virtual const char* mitk::RawImageFileReader::GetFilePattern ( ) const
virtual

Get the specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

◆ GetFilePrefix() [1/2]

virtual std::string mitk::RawImageFileReader::GetFilePrefix ( )
virtual

◆ GetFilePrefix() [2/2]

virtual const char* mitk::RawImageFileReader::GetFilePrefix ( ) const
virtual

Get the specified file prefix for the file(s) to load.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

◆ mitkClassMacro()

mitk::RawImageFileReader::mitkClassMacro ( RawImageFileReader  ,
FileReader   
)

◆ New()

static Pointer mitk::RawImageFileReader::New ( )
static

Method for creation through the object factory.

◆ SetDimensionality()

virtual void mitk::RawImageFileReader::SetDimensionality ( int  _arg)
virtual

◆ SetDimensions()

void mitk::RawImageFileReader::SetDimensions ( unsigned int  i,
unsigned int  dim 
)

Image dimensions must be set one by one, starting from dimension 0.

◆ SetEndianity()

virtual void mitk::RawImageFileReader::SetEndianity ( EndianityType  _arg)
virtual

◆ SetFileName() [1/2]

virtual void mitk::RawImageFileReader::SetFileName ( const char *  aFileName)
virtual

Specify the file to load.

Either the FileName or FilePrefix plus FilePattern are used to read.

Implements mitk::FileReader.

◆ SetFileName() [2/2]

virtual void mitk::RawImageFileReader::SetFileName ( std::string  _arg)
virtual

◆ SetFilePattern() [1/2]

virtual void mitk::RawImageFileReader::SetFilePattern ( const char *  aFilePattern)
virtual

Specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

◆ SetFilePattern() [2/2]

virtual void mitk::RawImageFileReader::SetFilePattern ( std::string  _arg)
virtual

◆ SetFilePrefix() [1/2]

virtual void mitk::RawImageFileReader::SetFilePrefix ( const char *  aFilePrefix)
virtual

Specify file prefix for the file(s) to load.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implements mitk::FileReader.

◆ SetFilePrefix() [2/2]

virtual void mitk::RawImageFileReader::SetFilePrefix ( std::string  _arg)
virtual

◆ SetPixelType()

virtual void mitk::RawImageFileReader::SetPixelType ( IOPixelType  _arg)
virtual

◆ TypedGenerateData()

template<typename TPixel , unsigned int VImageDimensions>
void mitk::RawImageFileReader::TypedGenerateData ( )
protected

Member Data Documentation

◆ m_Dimensionality

int mitk::RawImageFileReader::m_Dimensionality
protected

Dimensionality of file to be read. Can be 2 or 3.

Definition at line 92 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_Dimensions

itk::Vector<int, 3> mitk::RawImageFileReader::m_Dimensions
protected

Vector containing dimensions of image to be read.

Definition at line 98 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_Endianity

EndianityType mitk::RawImageFileReader::m_Endianity
protected

Endianity. Must be set to LITTLE or BIG. Default is BIG.

Definition at line 95 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_FileName

std::string mitk::RawImageFileReader::m_FileName
protected

Name of file to be read.

Definition at line 80 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_FilePattern

std::string mitk::RawImageFileReader::m_FilePattern
protected

File pattern.

Definition at line 86 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_FilePrefix

std::string mitk::RawImageFileReader::m_FilePrefix
protected

File prefix.

Definition at line 83 of file LegacyIO/mitkRawImageFileReader.h.

◆ m_PixelType

IOPixelType mitk::RawImageFileReader::m_PixelType
protected

Pixel type of image to be read. Must be of type IOPixelType.

Definition at line 89 of file LegacyIO/mitkRawImageFileReader.h.


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