Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
XML-based writer for mitk::PointSets. More...
#include <mitkPointSetWriter.h>
Public Types | |
typedef mitk::PointSet | InputType |
typedef InputType::Pointer | InputTypePointer |
Public Types inherited from mitk::FileWriter | |
typedef FileWriter | Self |
typedef itk::ProcessObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
mitkClassMacro (PointSetWriter, mitk::FileWriter) | |
Pointer | Clone () const |
virtual void | SetFileName (const char *_arg) |
virtual const char * | GetFileName () const |
virtual void | SetFilePrefix (const char *_arg) |
virtual const char * | GetFilePrefix () const |
virtual void | SetFilePattern (const char *_arg) |
virtual const char * | GetFilePattern () const |
void | SetInput (InputType *input) |
void | SetInput (const unsigned int &num, InputType *input) |
PointSet * | GetInput () |
PointSet * | GetInput (const unsigned int &num) |
virtual std::vector< std::string > | GetPossibleFileExtensions () override |
Return the possible file extensions for the data type associated with the writer. More... | |
virtual std::string | GetSupportedBaseData () const override |
virtual std::string | GetFileExtension () override |
Return the extension to be added to the filename. More... | |
virtual bool | CanWriteDataType (DataNode *) override |
Check if the Writer can write the Content of the. More... | |
virtual std::string | GetWritenMIMEType () override |
Return the MimeType of the saved File. More... | |
virtual void | SetInput (DataNode *) |
Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function. More... | |
bool | GetSuccess () const |
Public Member Functions inherited from mitk::FileWriter | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
bool | IsExtensionValid (std::string extension) |
Checks if given extension is valid for file writer. More... | |
virtual std::string | GetPossibleFileExtensionsAsString () |
possible file extensions for the data type associated with the writer as string More... | |
void | SetInput (BaseData *data) |
virtual void | Write ()=0 |
virtual bool | CanWriteToMemory () |
Specifies, whether the file writer also can write a file to a memory buffer. More... | |
virtual void | SetWriteToMemory (bool write) |
Set/Get functions to advise the file writer to use tis internal memory array as file writing destination. More... | |
virtual bool | GetWriteToMemory () |
virtual const char * | GetMemoryPointer () |
To be used along with a call of SetWriteToMemory(true). This returns the memory buffer where the file was written. More... | |
virtual unsigned int | GetMemorySize () |
To be used along with a call of SetWriteToMemory(true). This returns the size of the memory buffer where the file was written. More... | |
virtual void | ReleaseMemory () |
CAUTION: It's up to the user to call this function to release the memory buffer after use in case the file writer has written to its memory array. More... | |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from mitk::FileWriter | |
static const char * | GetStaticNameOfClass () |
Public Attributes | |
mitkWriterMacro | |
Static Public Attributes | |
static const char * | XML_POINT_SET |
static const char * | XML_TIME_SERIES |
static const char * | XML_TIME_SERIES_ID |
static const char * | XML_POINT_SET_FILE |
static const char * | XML_FILE_VERSION |
static const char * | XML_POINT |
static const char * | XML_SPEC |
static const char * | XML_ID |
static const char * | XML_X |
static const char * | XML_Y |
static const char * | XML_Z |
static const char * | VERSION_STRING |
Protected Member Functions | |
PointSetWriter () | |
virtual | ~PointSetWriter () |
virtual void | GenerateData () override |
virtual void | ResizeInputs (const unsigned int &num) |
template<typename T > | |
std::string | ConvertToString (T value) |
void | WriteXML (mitk::PointSet *pointSet, std::ofstream &out) |
void | WriteXMLHeader (std::ofstream &file) |
void | WriteStartElement (const char *const tag, std::ofstream &file) |
void | WriteEndElement (const char *const tag, std::ofstream &file, const bool &indent=true) |
void | WriteCharacterData (const char *const data, std::ofstream &file) |
void | WriteStartElement (std::string &tag, std::ofstream &file) |
void | WriteEndElement (std::string &tag, std::ofstream &file, const bool &indent=true) |
void | WriteCharacterData (std::string &data, std::ofstream &file) |
void | WriteIndent (std::ofstream &file) |
Protected Member Functions inherited from mitk::FileWriter | |
FileWriter () | |
virtual | ~FileWriter () |
Protected Attributes | |
std::string | m_FileName |
std::string | m_FilePrefix |
std::string | m_FilePattern |
std::string | m_Extension |
std::string | m_MimeType |
unsigned int | m_IndentDepth |
unsigned int | m_Indent |
bool | m_Success |
Protected Attributes inherited from mitk::FileWriter | |
bool | m_CanWriteToMemory |
bool | m_WriteToMemory |
char * | m_MemoryBuffer |
unsigned int | m_MemoryBufferSize |
XML-based writer for mitk::PointSets.
XML-based writer for mitk::PointSets. Multiple PointSets can be written in a single XML file by simply setting multiple inputs to the filter. Writing of multiple XML files according to a given filename pattern is not yet supported.
Definition at line 40 of file mitkPointSetWriter.h.
Definition at line 49 of file mitkPointSetWriter.h.
Definition at line 51 of file mitkPointSetWriter.h.
|
protected |
Constructor.
Definition at line 50 of file mitkPointSetWriter.cpp.
References m_Indent, m_IndentDepth, m_Success, and mitk::PointSet::New().
|
protectedvirtual |
Virtual destructor.
Definition at line 60 of file mitkPointSetWriter.cpp.
|
overridevirtual |
Check if the Writer can write the Content of the.
Reimplemented from mitk::FileWriter.
Definition at line 282 of file mitkPointSetWriter.cpp.
Pointer mitk::PointSetWriter::Clone | ( | ) | const |
|
protected |
Converts an arbitrary type to a string. The type has to support the << operator. This works fine at least for integral data types as float, int, long etc.
value | the value to convert |
Definition at line 213 of file mitkPointSetWriter.cpp.
|
overrideprotectedvirtual |
Writes the XML file
Definition at line 64 of file mitkPointSetWriter.cpp.
|
overridevirtual |
Return the extension to be added to the filename.
Reimplemented from mitk::FileWriter.
Definition at line 324 of file mitkPointSetWriter.cpp.
|
virtual |
Implements mitk::FileWriter.
|
virtual |
Implements mitk::FileWriter.
|
virtual |
Implements mitk::FileWriter.
mitk::PointSet * mitk::PointSetWriter::GetInput | ( | void | ) |
Definition at line 195 of file mitkPointSetWriter.cpp.
mitk::PointSet * mitk::PointSetWriter::GetInput | ( | const unsigned int & | num | ) |
num | the index of the desired output object. |
Definition at line 207 of file mitkPointSetWriter.cpp.
|
overridevirtual |
Return the possible file extensions for the data type associated with the writer.
Implements mitk::FileWriter.
Definition at line 312 of file mitkPointSetWriter.cpp.
bool mitk::PointSetWriter::GetSuccess | ( | ) | const |
Definition at line 277 of file mitkPointSetWriter.cpp.
|
overridevirtual |
Implements mitk::FileWriter.
Definition at line 319 of file mitkPointSetWriter.cpp.
|
overridevirtual |
Return the MimeType of the saved File.
Reimplemented from mitk::FileWriter.
Definition at line 307 of file mitkPointSetWriter.cpp.
mitk::PointSetWriter::mitkClassMacro | ( | PointSetWriter | , |
mitk::FileWriter | |||
) |
|
static |
|
protectedvirtual |
Resizes the number of inputs of the writer. The inputs are initialized by empty PointSets
num | the new number of inputs |
Definition at line 173 of file mitkPointSetWriter.cpp.
References mitk::PointSet::New().
|
virtual |
Sets the filename of the file to write.
FileName | the name of the file to write. |
Implements mitk::FileWriter.
|
virtual |
Implements mitk::FileWriter.
|
virtual |
Implements mitk::FileWriter.
void mitk::PointSetWriter::SetInput | ( | InputType * | input | ) |
Sets the 0'th input object for the filter.
input | the first input for the filter. |
Definition at line 183 of file mitkPointSetWriter.cpp.
void mitk::PointSetWriter::SetInput | ( | const unsigned int & | num, |
InputType * | input | ||
) |
Sets the n'th input object for the filter. If num is larger than GetNumberOfInputs() the number of inputs is resized appropriately.
input | the n'th input for the filter. |
Definition at line 188 of file mitkPointSetWriter.cpp.
|
virtual |
Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
Definition at line 301 of file mitkPointSetWriter.cpp.
|
protected |
Write character data inside a tag.
Definition at line 251 of file mitkPointSetWriter.cpp.
|
protected |
Write character data inside a tag.
Definition at line 266 of file mitkPointSetWriter.cpp.
|
protected |
Write an end element tag End-Elements following character data should pass indent = false.
Definition at line 240 of file mitkPointSetWriter.cpp.
|
protected |
Write an end element tag
Definition at line 261 of file mitkPointSetWriter.cpp.
|
protected |
Writes empty spaces to the stream according to m_IndentDepth and m_Indent
Definition at line 271 of file mitkPointSetWriter.cpp.
|
protected |
Write a start element tag
Definition at line 232 of file mitkPointSetWriter.cpp.
|
protected |
Write a start element tag
Definition at line 256 of file mitkPointSetWriter.cpp.
|
protected |
Writes an XML representation of the given point set to an outstream. The XML-Header an root node is not included!
pointSet | the point set to be converted to xml |
out | the stream to write to. |
Definition at line 123 of file mitkPointSetWriter.cpp.
References mitk::PointSet::GetPointSet(), mitk::PointSet::GetSpecificationTypeInfo(), and mitk::BaseData::GetTimeSteps().
|
protected |
Writes an standard xml header to the given stream.
file | the stream in which the header is written. |
Definition at line 227 of file mitkPointSetWriter.cpp.
|
protected |
Definition at line 219 of file mitkPointSetWriter.h.
|
protected |
Definition at line 213 of file mitkPointSetWriter.h.
|
protected |
Definition at line 217 of file mitkPointSetWriter.h.
|
protected |
Definition at line 215 of file mitkPointSetWriter.h.
|
protected |
Definition at line 225 of file mitkPointSetWriter.h.
Referenced by PointSetWriter().
|
protected |
Definition at line 223 of file mitkPointSetWriter.h.
Referenced by PointSetWriter().
|
protected |
Definition at line 221 of file mitkPointSetWriter.h.
|
protected |
Definition at line 227 of file mitkPointSetWriter.h.
Referenced by PointSetWriter().
mitk::PointSetWriter::mitkWriterMacro |
Definition at line 45 of file mitkPointSetWriter.h.
|
static |
Definition at line 252 of file mitkPointSetWriter.h.
|
static |
Definition at line 238 of file mitkPointSetWriter.h.
|
static |
Definition at line 244 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::CharacterDataHandler().
|
static |
Definition at line 240 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::EndElement(), and mitk::vtkPointSetXMLParser::StartElement().
|
static |
Definition at line 230 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::EndElement(), and mitk::vtkPointSetXMLParser::StartElement().
|
static |
Definition at line 236 of file mitkPointSetWriter.h.
|
static |
Definition at line 242 of file mitkPointSetWriter.h.
|
static |
Definition at line 232 of file mitkPointSetWriter.h.
|
static |
Definition at line 234 of file mitkPointSetWriter.h.
|
static |
Definition at line 246 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::CharacterDataHandler().
|
static |
Definition at line 248 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::CharacterDataHandler().
|
static |
Definition at line 250 of file mitkPointSetWriter.h.
Referenced by mitk::vtkPointSetXMLParser::CharacterDataHandler().