STIR
6.2.0
|
Classes | |
class | stir::InterfileDynamicDiscretisedDensityOutputFileFormat |
Implementation of OutputFileFormat paradigm for the Interfile format. More... | |
class | stir::MinimalInterfileHeader |
a minimal class for Interfile keywords (and parsing) common to all types of data More... | |
class | stir::InterfileHeader |
a class for Interfile keywords (and parsing) common to all types of data More... | |
class | stir::InterfileImageHeader |
a class for Interfile keywords (and parsing) specific to images More... | |
class | stir::InterfilePDFSHeader |
a class for Interfile keywords (and parsing) specific to projection data (i.e. ProjDataFromStream) More... | |
class | stir::InterfileOutputFileFormat |
Implementation of OutputFileFormat paradigm for the Interfile format. More... | |
class | stir::InterfileParametricDiscretisedDensityOutputFileFormat< DiscDensityT > |
Implementation of OutputFileFormat paradigm for the Interfile format. More... | |
class | stir::InterfilePDFSHeaderSPECT |
a class for Interfile keywords (and parsing) specific to SPECT projection data More... | |
Functions | |
bool | stir::is_interfile_signature (const char *const signature) |
Checks if the signature corresponds to the start of an interfile header. More... | |
VoxelsOnCartesianGrid< float > * | stir::read_interfile_image (std::istream &input, const std::string &directory_for_data="") |
This reads the first 3d image in an Interfile header file, given as a stream. More... | |
VoxelsOnCartesianGrid< float > * | stir::read_interfile_image (const std::string &filename) |
This reads the first 3d image in an Interfile header file, given as a filename. More... | |
Succeeded | stir::write_basic_interfile_image_header (const std::string &header_file_name, const std::string &image_file_name, const ExamInfo &exam_info, const IndexRange< 3 > &index_range, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type, const ByteOrder byte_order, const VectorWithOffset< float > &scaling_factors, const VectorWithOffset< unsigned long > &file_offsets, const std::vector< std::string > &data_type_descriptions=std::vector< std::string >()) |
This outputs an Interfile header for an image. More... | |
const VectorWithOffset< unsigned long > | stir::compute_file_offsets (int number_of_time_frames, const NumericType output_type, const Coordinate3D< int > &dim, unsigned long initial_offset=0) |
a utility function that computes the file offsets of subsequent images | |
template<class elemT > | |
Succeeded | stir::write_basic_interfile (const std::string &filename, const Array< 3, elemT > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native) |
This outputs an Interfile header and data for a Array<3,elemT> object. More... | |
template<class elemT > | |
Succeeded | stir::write_basic_interfile (const std::string &filename, const ExamInfo &exam_info, const Array< 3, elemT > &image, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< float > &origin, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native) |
This outputs an Interfile header and data for a Array<3,elemT> object. More... | |
template<class elemT > | |
Succeeded | stir::write_basic_interfile (const std::string &filename, const Array< 3, elemT > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native) |
This outputs an Interfile header and data for a Array<3,elemT> object, assuming unit voxel sizes. More... | |
Succeeded | stir::write_basic_interfile (const std::string &filename, const VoxelsOnCartesianGrid< float > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native) |
This outputs an Interfile header and data for a VoxelsOnCartesianGrid<float> object. More... | |
Succeeded | stir::write_basic_interfile (const std::string &filename, const DiscretisedDensity< 3, float > &image, const NumericType output_type=NumericType::FLOAT, const float scale=0, const ByteOrder byte_order=ByteOrder::native) |
This outputs an Interfile header and data for a DiscretisedDensity<3,float> object. More... | |
ProjDataFromStream * | stir::read_interfile_PDFS (std::istream &input, const std::string &directory_for_data="", const std::ios::openmode openmode=std::ios::in) |
This reads the first 3D sinogram from an Interfile header, given as a stream. More... | |
ProjDataFromStream * | stir::read_interfile_PDFS (const std::string &filename, const std::ios::openmode open_mode) |
This reads the first 3D sinogram from an Interfile header, given as a filename. More... | |
Succeeded | stir::write_basic_interfile_PDFS_header (const std::string &header_filename, const std::string &data_filename, const ProjDataFromStream &pdfs) |
This writes an Interfile header appropriate for the ProjDataFromStream object. More... | |
Succeeded | stir::write_basic_interfile_PDFS_header (const std::string &data_filename, const ProjDataFromStream &pdfs) |
This function writes an Interfile header for the pdfs object. More... | |
bool stir::is_interfile_signature | ( | const char *const | signature | ) |
Checks if the signature corresponds to the start of an interfile header.
The first line of an Interfile header should contain the
INTERFILE :=
(potentially preceded by an exclamation mark, and maybe in mixed or lower case). This function checks if the list of characters pointed to by signature satifies these requirements.
References stir::standardise_interfile_keyword().
Referenced by stir::DynamicProjData::set_start_time_in_secs_since_1970(), and stir::TimeFrameDefinitions::TimeFrameDefinitions().
VoxelsOnCartesianGrid< float > * stir::read_interfile_image | ( | std::istream & | input, |
const std::string & | directory_for_data = "" |
||
) |
This reads the first 3d image in an Interfile header file, given as a stream.
If there is trouble interpreting the header, VoxelsOnCartesianGrid<float>::ask_parameters() is called instead If the name for the data file is not an absolute pathname, directory_for_data is prepended (if not NULL).
This should normally never be used. Use read_from_file<DiscretisedDensity<3,float> >() instead.
References stir::max_filename_length.
Referenced by stir::InterfileImageInputFileFormat::read_from_file(), and stir::read_interfile_image().
VoxelsOnCartesianGrid< float > * stir::read_interfile_image | ( | const std::string & | filename | ) |
This reads the first 3d image in an Interfile header file, given as a filename.
The function first opens a stream from 'filename' and then calls the previous function with 'directory_for_data' set to the directory part of 'filename'.
This should normally never be used. Use read_from_file<DiscretisedDensity<3,float> >() instead.
References stir::error(), stir::get_directory_name(), stir::max_filename_length, and stir::read_interfile_image().
Succeeded stir::write_basic_interfile_image_header | ( | const std::string & | header_file_name, |
const std::string & | image_file_name, | ||
const ExamInfo & | exam_info, | ||
const IndexRange< 3 > & | index_range, | ||
const CartesianCoordinate3D< float > & | voxel_size, | ||
const CartesianCoordinate3D< float > & | origin, | ||
const NumericType | output_type, | ||
const ByteOrder | byte_order, | ||
const VectorWithOffset< float > & | scaling_factors, | ||
const VectorWithOffset< unsigned long > & | file_offsets, | ||
const std::vector< std::string > & | data_type_descriptions = std::vector<std::string>() |
||
) |
This outputs an Interfile header for an image.
A .hv extension will be added to the header_file_name if none is present.
In fact, at the moment 2 headers are output:
They both point to the same file with binary data.
References stir::add_extension(), stir::IndexRange< num_dimensions >::get_regular_range(), and stir::warning().
Succeeded stir::write_basic_interfile | ( | const std::string & | filename, |
const Array< 3, elemT > & | image, | ||
const CartesianCoordinate3D< float > & | voxel_size, | ||
const CartesianCoordinate3D< float > & | origin, | ||
const NumericType | output_type = NumericType::FLOAT , |
||
const float | scale = 0 , |
||
const ByteOrder | byte_order = ByteOrder::native |
||
) |
This outputs an Interfile header and data for a Array<3,elemT> object.
Extension .v will be added to the parameter 'filename' (if no extension present). Extensions .hv (and .ahv) will be used for the header filename.
Referenced by stir::InterfileOutputFileFormat::actual_write_to_file(), and stir::InterfileDynamicDiscretisedDensityOutputFileFormat::actual_write_to_file().
Succeeded stir::write_basic_interfile | ( | const std::string & | filename, |
const ExamInfo & | exam_info, | ||
const Array< 3, elemT > & | image, | ||
const CartesianCoordinate3D< float > & | voxel_size, | ||
const CartesianCoordinate3D< float > & | origin, | ||
const NumericType | output_type = NumericType::FLOAT , |
||
const float | scale = 0 , |
||
const ByteOrder | byte_order = ByteOrder::native |
||
) |
This outputs an Interfile header and data for a Array<3,elemT> object.
Extension .v will be added to the parameter 'filename' (if no extension present). Extensions .hv (and .ahv) will be used for the header filename.
Succeeded stir::write_basic_interfile | ( | const std::string & | filename, |
const Array< 3, elemT > & | image, | ||
const NumericType | output_type = NumericType::FLOAT , |
||
const float | scale = 0 , |
||
const ByteOrder | byte_order = ByteOrder::native |
||
) |
This outputs an Interfile header and data for a Array<3,elemT> object, assuming unit voxel sizes.
Extension .v will be added to the parameter 'filename' (if no extension present). Extensions .hv (and .ahv) will be used for the header filename.
Succeeded stir::write_basic_interfile | ( | const std::string & | filename, |
const VoxelsOnCartesianGrid< float > & | image, | ||
const NumericType | output_type = NumericType::FLOAT , |
||
const float | scale = 0 , |
||
const ByteOrder | byte_order = ByteOrder::native |
||
) |
This outputs an Interfile header and data for a VoxelsOnCartesianGrid<float> object.
Extension .v will be added to the parameter 'filename' (if no extension present). Extensions .hv (and .ahv) will be used for the header filename.
Succeeded stir::write_basic_interfile | ( | const std::string & | filename, |
const DiscretisedDensity< 3, float > & | image, | ||
const NumericType | output_type = NumericType::FLOAT , |
||
const float | scale = 0 , |
||
const ByteOrder | byte_order = ByteOrder::native |
||
) |
This outputs an Interfile header and data for a DiscretisedDensity<3,float> object.
Extension .v will be added to the parameter 'filename' (if no extension present). Extensions .hv (and .ahv) will be used for the header filename.
Currently the DiscretisedDensity<3,float>& object has to be a reference to a VoxelsOnCartesianGrid<float> object.
ProjDataFromStream* stir::read_interfile_PDFS | ( | std::istream & | input, |
const std::string & | directory_for_data = "" , |
||
const std::ios::openmode | openmode = std::ios::in |
||
) |
This reads the first 3D sinogram from an Interfile header, given as a stream.
If there is trouble interpreting the header, ProjDataFromStream::ask_parameters() is called instead
input | A stream giving the Interfile header. |
directory_for_data | If the name for the data file is not an absolute pathname, this string is prepended. |
openmode | Mode for opening the data file. ios::binary will be added by the code. |
ProjDataFromStream* stir::read_interfile_PDFS | ( | const std::string & | filename, |
const std::ios::openmode | open_mode | ||
) |
This reads the first 3D sinogram from an Interfile header, given as a filename.
This first opens a stream and then calls the previous function with 'directory_for_data' set to the directory part of 'filename'.
This should normally never be used. Use ProjData::read_from_file() instead.
Succeeded stir::write_basic_interfile_PDFS_header | ( | const std::string & | header_filename, |
const std::string & | data_filename, | ||
const ProjDataFromStream & | pdfs | ||
) |
This writes an Interfile header appropriate for the ProjDataFromStream object.
A .hs extension will be added to the header_file_name if none is present.
References stir::add_extension(), and stir::warning().
Referenced by stir::ProjDataFromStream::set_segment(), and stir::write_basic_interfile_PDFS_header().
Succeeded stir::write_basic_interfile_PDFS_header | ( | const std::string & | data_filename, |
const ProjDataFromStream & | pdfs | ||
) |
This function writes an Interfile header for the pdfs object.
The header_filename is found by replacing the extension in the data_filename with .hs
References stir::add_extension(), stir::find_filename(), stir::find_pos_of_extension(), stir::max_filename_length, stir::replace_extension(), and stir::write_basic_interfile_PDFS_header().