SimpleITK
2.0.0
|
Write out a SimpleITK image to the specified file location. More...
#include <sitkImageFileWriter.h>
Public Types | |
using | PixelIDTypeList = NonLabelPixelIDTypeList |
using | Self = ImageFileWriter |
Public Types inherited from itk::simple::ProcessObject | |
using | Self = ProcessObject |
Public Member Functions | |
Self & | Execute (const Image &) |
Self & | Execute (const Image &, const std::string &inFileName, bool useCompression, int compressionLevel) |
std::string | GetFileName () const |
std::string | GetName () const override |
virtual std::vector< std::string > | GetRegisteredImageIOs () const |
Get a vector of the names of registered itk ImageIOs. More... | |
ImageFileWriter () | |
Self & | SetFileName (const std::string &fileName) |
std::string | ToString () const override |
~ImageFileWriter () override | |
Self & | SetUseCompression (bool UseCompression) |
Enable compression if available for file type. More... | |
bool | GetUseCompression () const |
Enable compression if available for file type. More... | |
Self & | UseCompressionOn () |
Enable compression if available for file type. More... | |
Self & | UseCompressionOff () |
Enable compression if available for file type. More... | |
Self & | SetCompressionLevel (int) |
A hint for the amount of compression to be applied during writing. More... | |
int | GetCompressionLevel () const |
A hint for the amount of compression to be applied during writing. More... | |
Self & | SetCompressor (const std::string &) |
A compression algorithm hint. More... | |
std::string | GetCompressor () |
A compression algorithm hint. More... | |
virtual Self & | SetImageIO (const std::string &imageio) |
Set/Get name of ImageIO to use. More... | |
virtual std::string | GetImageIO () const |
Set/Get name of ImageIO to use. More... | |
Self & | SetKeepOriginalImageUID (bool KeepOriginalImageUID) |
Use the original study/series/frame of reference. More... | |
bool | GetKeepOriginalImageUID () const |
Set/Get name of ImageIO to use. More... | |
Self & | KeepOriginalImageUIDOn () |
Set/Get name of ImageIO to use. More... | |
Self & | KeepOriginalImageUIDOff () |
Set/Get name of ImageIO to use. More... | |
Public Member Functions inherited from itk::simple::ProcessObject | |
virtual void | Abort () |
virtual int | AddCommand (itk::simple::EventEnum event, const std::function< void()> &func) |
Directly add a callback to observe an event. More... | |
virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
Add a Command Object to observer the event. More... | |
virtual float | GetProgress () const |
An Active Measurement of the progress of execution. More... | |
virtual bool | HasCommand (itk::simple::EventEnum event) const |
Query of this object has any registered commands for event. More... | |
ProcessObject () | |
virtual void | RemoveAllCommands () |
Remove all registered commands. More... | |
virtual | ~ProcessObject () |
virtual void | DebugOn () |
virtual void | DebugOff () |
virtual bool | GetDebug () const |
virtual void | SetDebug (bool debugFlag) |
virtual void | SetNumberOfThreads (unsigned int n) |
virtual unsigned int | GetNumberOfThreads () const |
virtual void | SetNumberOfWorkUnits (unsigned int n) |
virtual unsigned int | GetNumberOfWorkUnits () const |
Private Types | |
typedef Self &(Self::* | MemberFunctionType) (const Image &) |
Private Member Functions | |
template<class T > | |
Self & | ExecuteInternal (const Image &) |
itk::SmartPointer< ImageIOBase > | GetImageIOBase (const std::string &fileName) |
Private Attributes | |
int | m_CompressionLevel |
std::string | m_Compressor |
std::string | m_FileName |
std::string | m_ImageIOName |
bool | m_KeepOriginalImageUID |
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > | m_MemberFactory |
bool | m_UseCompression |
Friends | |
struct | detail::MemberFunctionAddressor< MemberFunctionType > |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::simple::ProcessObject | |
static bool | GetGlobalDefaultDebug () |
static void | GlobalDefaultDebugOff () |
static void | GlobalDefaultDebugOn () |
static void | SetGlobalDefaultDebug (bool debugFlag) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static void | SetGlobalWarningDisplay (bool flag) |
static bool | GetGlobalWarningDisplay () |
static double | GetGlobalDefaultCoordinateTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultCoordinateTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static double | GetGlobalDefaultDirectionTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultDirectionTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static bool | SetGlobalDefaultThreader (const std::string &threader) |
Set/Get the default threader used for process objects. More... | |
static std::string | GetGlobalDefaultThreader () |
Set/Get the default threader used for process objects. More... | |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
Set/Get the default threader used for process objects. More... | |
Protected Member Functions inherited from itk::simple::ProcessObject | |
virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
virtual itk::ProcessObject * | GetActiveProcess () |
virtual void | OnActiveProcessDelete () |
virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
virtual void | PreUpdate (itk::ProcessObject *p) |
virtual void | RemoveITKObserver (EventCommand &e) |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
Static Protected Member Functions inherited from itk::simple::ProcessObject | |
template<class TImageType > | |
static TImageType::ConstPointer | CastImageToITK (const Image &img) |
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
template<class TImageType > | |
static Image | CastITKToImage (TImageType *img) |
static const itk::EventObject & | GetITKEventObject (EventEnum e) |
template<typename T > | |
static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
Write out a SimpleITK image to the specified file location.
This writer tries to write the image out using the image's type to the location specified in FileName. If writing fails, an ITK exception is thrown.
Definition at line 48 of file sitkImageFileWriter.h.
Definition at line 159 of file sitkImageFileWriter.h.
Definition at line 55 of file sitkImageFileWriter.h.
Definition at line 52 of file sitkImageFileWriter.h.
|
override |
itk::simple::ImageFileWriter::ImageFileWriter | ( | ) |
Self& itk::simple::ImageFileWriter::Execute | ( | const Image & | , |
const std::string & | inFileName, | ||
bool | useCompression, | ||
int | compressionLevel | ||
) |
int itk::simple::ImageFileWriter::GetCompressionLevel | ( | ) | const |
A hint for the amount of compression to be applied during writing.
After compression is enabled and if the itk::ImageIO support this option, then this value may be used. The range is dependent upon the compression algorithm used. It is generally 0-100 for JPEG like lossy compression and 0-9 for lossless zip or LZW like compression algorithms. Please see the specific itk::ImageIO for details.
std::string itk::simple::ImageFileWriter::GetCompressor | ( | ) |
A compression algorithm hint.
The default is an empty string which enables the default compression of the ImageIO if compression is enabled. If the string identifier is not known a warning is produced and the default compressor is used. Please see the itk::ImageIO for details.
std::string itk::simple::ImageFileWriter::GetFileName | ( | ) | const |
|
virtual |
Set/Get name of ImageIO to use.
An option to override the automatically detected ImageIO used to write the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated.
The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.
|
private |
bool itk::simple::ImageFileWriter::GetKeepOriginalImageUID | ( | ) | const |
Set/Get name of ImageIO to use.
An option to override the automatically detected ImageIO used to write the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated.
The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.
|
inlineoverridevirtual |
return user readable name of the filter
Implements itk::simple::ProcessObject.
Definition at line 65 of file sitkImageFileWriter.h.
|
virtual |
Get a vector of the names of registered itk ImageIOs.
bool itk::simple::ImageFileWriter::GetUseCompression | ( | ) | const |
Enable compression if available for file type.
These methods Set/Get/Toggle the UseCompression flag which get's passed to image file's itk::ImageIO object. This is only a request as not all file formats support compression.
|
inline |
Set/Get name of ImageIO to use.
An option to override the automatically detected ImageIO used to write the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated.
The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.
Definition at line 135 of file sitkImageFileWriter.h.
|
inline |
Set/Get name of ImageIO to use.
An option to override the automatically detected ImageIO used to write the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated.
The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.
Definition at line 134 of file sitkImageFileWriter.h.
Self& itk::simple::ImageFileWriter::SetCompressionLevel | ( | int | ) |
A hint for the amount of compression to be applied during writing.
After compression is enabled and if the itk::ImageIO support this option, then this value may be used. The range is dependent upon the compression algorithm used. It is generally 0-100 for JPEG like lossy compression and 0-9 for lossless zip or LZW like compression algorithms. Please see the specific itk::ImageIO for details.
Self& itk::simple::ImageFileWriter::SetCompressor | ( | const std::string & | ) |
A compression algorithm hint.
The default is an empty string which enables the default compression of the ImageIO if compression is enabled. If the string identifier is not known a warning is produced and the default compressor is used. Please see the itk::ImageIO for details.
Self& itk::simple::ImageFileWriter::SetFileName | ( | const std::string & | fileName | ) |
|
virtual |
Set/Get name of ImageIO to use.
An option to override the automatically detected ImageIO used to write the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not be constructed an exception will be generated.
The default value is an empty string (""). This indicates that the ImageIO will be automatically determined by the ITK ImageIO factory mechanism.
Self& itk::simple::ImageFileWriter::SetKeepOriginalImageUID | ( | bool | KeepOriginalImageUID | ) |
Use the original study/series/frame of reference.
These methods Set/Get/Toggle the KeepOriginalImageUID flag which get's passed to image file's itk::ImageIO object. This is relevant only for the DICOM file format, configuring the writer to use the information in the image's meta-data dictionary or to create new study/series/frame of reference values.
Self& itk::simple::ImageFileWriter::SetUseCompression | ( | bool | UseCompression | ) |
Enable compression if available for file type.
These methods Set/Get/Toggle the UseCompression flag which get's passed to image file's itk::ImageIO object. This is only a request as not all file formats support compression.
|
overridevirtual |
Print ourselves to string
Reimplemented from itk::simple::ProcessObject.
|
inline |
Enable compression if available for file type.
These methods Set/Get/Toggle the UseCompression flag which get's passed to image file's itk::ImageIO object. This is only a request as not all file formats support compression.
Definition at line 82 of file sitkImageFileWriter.h.
|
inline |
Enable compression if available for file type.
These methods Set/Get/Toggle the UseCompression flag which get's passed to image file's itk::ImageIO object. This is only a request as not all file formats support compression.
Definition at line 81 of file sitkImageFileWriter.h.
|
friend |
Definition at line 162 of file sitkImageFileWriter.h.
|
private |
Definition at line 151 of file sitkImageFileWriter.h.
|
private |
Definition at line 152 of file sitkImageFileWriter.h.
|
private |
Definition at line 154 of file sitkImageFileWriter.h.
|
private |
Definition at line 156 of file sitkImageFileWriter.h.
|
private |
Definition at line 155 of file sitkImageFileWriter.h.
|
private |
Definition at line 164 of file sitkImageFileWriter.h.
|
private |
Definition at line 150 of file sitkImageFileWriter.h.