STIR  6.2.0
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
stir::ecat::ecat7::ECAT7OutputFileFormat Class Reference

Implementation of OutputFileFormat paradigm for the ECAT7 format. More...

#include "stir/IO/ECAT7OutputFileFormat.h"

Inheritance diagram for stir::ecat::ecat7::ECAT7OutputFileFormat:
Inheritance graph
[legend]

Public Member Functions

 ECAT7OutputFileFormat (const NumericType &=NumericType::SHORT, const ByteOrder &=ByteOrder::native)
 
virtual NumericType set_type_of_numbers (const NumericType &, const bool warn=false)
 Set type of numbers to be used for output. More...
 
virtual ByteOrder set_byte_order (const ByteOrder &, const bool warn=false)
 Set byte order to be used for output. More...
 
- Public Member Functions inherited from stir::RegisteredParsingObject< ECAT7OutputFileFormat, OutputFileFormat< DiscretisedDensity< 3, float > >, OutputFileFormat< DiscretisedDensity< 3, float > > >
std::string get_registered_name () const override
 Returns Derived::registered_name.
 
std::string parameter_info () override
 Returns a string with all parameters and their values, in a form suitable for parsing again.
 
- Public Member Functions inherited from stir::OutputFileFormat< DiscretisedDensity< 3, float > >
 OutputFileFormat (const NumericType &=NumericType::FLOAT, const ByteOrder &=ByteOrder::native)
 
Succeeded write_to_file (std::string &filename, const DiscretisedDensity< 3, float > &data) const
 Write a single image to file. More...
 
Succeeded write_to_file (const std::string &filename, const DiscretisedDensity< 3, float > &density) const
 write a single image to file More...
 
NumericType get_type_of_numbers () const
 get type used for outputting numbers
 
ByteOrder get_byte_order ()
 get byte order used for output
 
float get_scale_to_write_data () const
 get scale to write the data More...
 
virtual void set_byte_order_and_type_of_numbers (ByteOrder &, NumericType &, const bool warn=false)
 set byte order and data type used for output More...
 
virtual float set_scale_to_write_data (const float new_scale_to_write_data, const bool warn=false)
 set scale outputting numbers More...
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 

Public Attributes

std::string default_scanner_name
 

Static Public Attributes

static const char *const registered_name = "ECAT7"
 Name which will be used when parsing an OutputFileFormat object.
 

Protected Member Functions

virtual Succeeded actual_write_to_file (std::string &output_filename, const DiscretisedDensity< 3, float > &density) const
 virtual function called by write_to_file() More...
 
virtual void set_defaults ()
 Set defaults before parsing.
 
virtual void initialise_keymap ()
 Initialise all keywords.
 
virtual bool post_processing ()
 This will be called at the end of the parsing. More...
 
- Protected Member Functions inherited from stir::OutputFileFormat< DiscretisedDensity< 3, float > >
void set_defaults () override
 sets value for output data type More...
 
void initialise_keymap () override
 sets keys for output data type for parsing More...
 
bool post_processing () override
 Checks if parameters have sensible values after parsing. More...
 
void set_key_values () override
 overloaded member for ParsingObject::set_key_values() More...
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< ECAT7OutputFileFormat, OutputFileFormat< DiscretisedDensity< 3, float > >, OutputFileFormat< DiscretisedDensity< 3, float > > >
static OutputFileFormat< DiscretisedDensity< 3, float > > * read_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream. More...
 
- Static Public Member Functions inherited from stir::OutputFileFormat< DiscretisedDensity< 3, float > >
static shared_ptr< OutputFileFormat< DiscretisedDensity< 3, float > > > default_sptr ()
 A function to return a default output file format.
 
- Static Public Member Functions inherited from stir::RegisteredObject< OutputFileFormat< DiscretisedDensity< 3, float > > >
static OutputFileFormat< DiscretisedDensity< 3, float > > * read_registered_object (std::istream *in, const std::string &registered_name)
 Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More...
 
static OutputFileFormat< DiscretisedDensity< 3, float > > * ask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type) More...
 
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream. More...
 
- Protected Types inherited from stir::RegisteredObject< OutputFileFormat< DiscretisedDensity< 3, float > > >
typedef OutputFileFormat< DiscretisedDensity< 3, float > > *(* RootFactory) (std::istream *)
 The type of a root factory is a function, taking an istream* as argument, and returning a Root*.
 
typedef FactoryRegistry< std::string, RootFactory, interfile_lessRegistryType
 The type of the registry.
 
- Static Protected Member Functions inherited from stir::RegisteredObject< OutputFileFormat< DiscretisedDensity< 3, float > > >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 
- Protected Attributes inherited from stir::OutputFileFormat< DiscretisedDensity< 3, float > >
NumericType type_of_numbers
 type used for outputting numbers
 
ByteOrder file_byte_order
 byte order used for output
 
float scale_to_write_data
 scale to write the data More...
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Detailed Description

Implementation of OutputFileFormat paradigm for the ECAT7 format.

Warning
Currently output always uses 2-byte signed integers in big-endian byte order.

Member Function Documentation

◆ set_type_of_numbers()

NumericType stir::ecat::ecat7::ECAT7OutputFileFormat::set_type_of_numbers ( const NumericType new_type,
const bool  warn = false 
)
virtual

Set type of numbers to be used for output.

Currently the return value will always be NumericType::SHORT

Reimplemented from stir::OutputFileFormat< DiscretisedDensity< 3, float > >.

References stir::warning().

◆ set_byte_order()

ByteOrder stir::ecat::ecat7::ECAT7OutputFileFormat::set_byte_order ( const ByteOrder new_byte_order,
const bool  warn = false 
)
virtual

Set byte order to be used for output.

Currently the return value will always be ByteOrder::BIGENDIAN

Reimplemented from stir::OutputFileFormat< DiscretisedDensity< 3, float > >.

References stir::warning().

◆ actual_write_to_file()

Succeeded stir::ecat::ecat7::ECAT7OutputFileFormat::actual_write_to_file ( std::string &  filename,
const DiscretisedDensity< 3, float > &  density 
) const
protectedvirtual

virtual function called by write_to_file()

This function has to be overloaded by the derived class.

The reason we do not simply make write_to_file() virtual is that we have 2 versions of write_to_file. C++ rules are such that overloading the virtual function in a derived class means that the other version gets hidden. Having the non-virtual write_to_file() call the virtual actual_write_to_file() solves this problem.

Implements stir::OutputFileFormat< DiscretisedDensity< 3, float > >.

References stir::add_extension(), stir::ecat::ecat7::DiscretisedDensity_to_ECAT7(), stir::ecat::ecat7::make_ECAT7_main_header(), and stir::warning().

◆ post_processing()

bool stir::ecat::ecat7::ECAT7OutputFileFormat::post_processing ( )
protectedvirtual

This will be called at the end of the parsing.

Returns
false if everything OK, true if not

Reimplemented from stir::ParsingObject.

References stir::ecat::find_ECAT_system_type(), and stir::warning().


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