Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::VtiFileReader Class Reference
[IO Classes]

Reader to read image files in vtk file format. More...

#include <mitkVtiFileReader.h>

Inheritance diagram for mitk::VtiFileReader:
Inheritance graph
[legend]
Collaboration diagram for mitk::VtiFileReader:
Collaboration graph
[legend]

List of all members.

Public Types

typedef VtiFileReader Self
typedef FileReader Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual void SetFileName (const char *_arg)
 Specify the file to load.
virtual const char * GetFileName () const
 Get the specified the file to load.
virtual void SetFilePrefix (const char *_arg)
 Specify file prefix for the file(s) to load.
virtual const char * GetFilePrefix () const
 Get the specified file prefix for the file(s) to load.
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.
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.

Static Public Member Functions

static Pointer New ()
static bool CanReadFile (const std::string filename, const std::string filePrefix, const std::string filePattern)

Protected Member Functions

 VtiFileReader ()
 ~VtiFileReader ()
virtual void GenerateData ()
 A version of GenerateData() specific for image processing filters.

Protected Attributes

std::string m_FileName
std::string m_FilePrefix
std::string m_FilePattern

Detailed Description

Reader to read image files in vtk file format.

Definition at line 30 of file mitkVtiFileReader.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::VtiFileReader::ConstPointer

Definition at line 33 of file mitkVtiFileReader.h.

typedef itk::SmartPointer<Self> mitk::VtiFileReader::Pointer

Definition at line 33 of file mitkVtiFileReader.h.

Definition at line 33 of file mitkVtiFileReader.h.

Definition at line 33 of file mitkVtiFileReader.h.


Constructor & Destructor Documentation

mitk::VtiFileReader::VtiFileReader (  ) [protected]

Definition at line 23 of file mitkVtiFileReader.cpp.

mitk::VtiFileReader::~VtiFileReader (  ) [protected]

Definition at line 28 of file mitkVtiFileReader.cpp.

{
}

Member Function Documentation

bool mitk::VtiFileReader::CanReadFile ( const std::string  filename,
const std::string  filePrefix,
const std::string  filePattern 
) [static]

Definition at line 50 of file mitkVtiFileReader.cpp.

{
  // First check the extension
  if(  filename == "" )
    return false;

  bool extensionFound = false;
  std::string::size_type VTIPos = filename.rfind(".vti");
  if ((VTIPos != std::string::npos) && (VTIPos == filename.length() - 4))
    extensionFound = true;

  VTIPos = filename.rfind(".VTI");
  if ((VTIPos != std::string::npos) && (VTIPos == filename.length() - 4))
    extensionFound = true;

  if (!extensionFound)
    return false;

  return true;
}
void mitk::VtiFileReader::GenerateData (  ) [protected, virtual]

A version of GenerateData() specific for image processing filters.

This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling ThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter an be threaded, it should NOT provide a GenerateData() method but should provide a ThreadedGenerateData() instead.

See also:
ThreadedGenerateData()

Reimplemented from mitk::ImageSource.

Definition at line 32 of file mitkVtiFileReader.cpp.

{
  if( m_FileName != "")
  {
  vtkXMLImageDataReader * vtkReader = vtkXMLImageDataReader::New();
  vtkReader->SetFileName( m_FileName.c_str() );
  vtkReader->Update();

  if ( vtkReader->GetOutput() != NULL )
  {
    mitk::Image::Pointer output = this->GetOutput();
    output->Initialize( vtkReader->GetOutput() );
    output->SetVolume( vtkReader->GetOutput()->GetScalarPointer() );
  }
  vtkReader->Delete();
  }
}
virtual const char* mitk::VtiFileReader::GetClassName (  ) const [virtual]
virtual const char* mitk::VtiFileReader::GetFileName (  ) const [virtual]

Get the specified the file to load.

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

Implements mitk::FileReader.

virtual const char* mitk::VtiFileReader::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.

virtual const char* mitk::VtiFileReader::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.

static Pointer mitk::VtiFileReader::New (  ) [static]

Method for creation through the object factory.

Reimplemented from mitk::ImageSource.

virtual void mitk::VtiFileReader::SetFileName ( const char *  aFileName ) [virtual]

Specify the file to load.

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

Implements mitk::FileReader.

virtual void mitk::VtiFileReader::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.

virtual void mitk::VtiFileReader::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.


Member Data Documentation

std::string mitk::VtiFileReader::m_FileName [protected]

Definition at line 62 of file mitkVtiFileReader.h.

std::string mitk::VtiFileReader::m_FilePattern [protected]

Definition at line 66 of file mitkVtiFileReader.h.

std::string mitk::VtiFileReader::m_FilePrefix [protected]

Definition at line 64 of file mitkVtiFileReader.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines