20 #include "itksys/SystemTools.hxx"
45 MITK_INFO <<
"Writing connectomics network";
49 MITK_ERROR <<
"Sorry, input to ConnectomicsNetworkWriter is NULL!";
52 if ( this->GetOutputLocation().empty() )
54 MITK_ERROR <<
"Sorry, filename has not been set!" ;
58 std::string ext = itksys::SystemTools::GetFilenameLastExtension(this->GetOutputLocation());
59 ext = itksys::SystemTools::LowerCase(ext);
65 this->SetOutputLocation(this->GetOutputLocation() + ext);
74 TiXmlDocument documentXML;
76 TiXmlDeclaration* declXML =
new TiXmlDeclaration(
"1.0",
"",
"" );
77 documentXML.LinkEndChild( declXML );
81 documentXML.LinkEndChild(mainXML);
104 mainXML->LinkEndChild(geometryXML);
109 for(
unsigned int index = 0; index < vertexVector.size(); index++ )
118 verticesXML->LinkEndChild(vertexXML);
121 mainXML->LinkEndChild(verticesXML);
126 for(
unsigned int index = 0; index < edgeVector.size(); index++ )
134 edgesXML->LinkEndChild(edgeXML);
137 mainXML->LinkEndChild(edgesXML);
140 documentXML.SaveFile( this->GetOutputLocation().c_str() );
141 MITK_INFO <<
"Connectomics network written";
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
static const char * XML_EDGES
static const char * XML_MATRIX_ZX
static const char * XML_MATRIX_ZY
static const char * XML_MATRIX_XX
static const char * XML_EDGE_DOUBLE_WEIGHT_ID
DataCollection - Class to facilitate loading/accessing structured data.
static const char * XML_MATRIX_YY
virtual ~ConnectomicsNetworkWriter()
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
ConnectomicsNetworkWriter()
static const char * XML_ORIGIN_X
static const char * XML_MATRIX_XZ
static const char * XML_VERTEX_Z
static const char * XML_MATRIX_ZZ
static const char * XML_VERTEX_ID
VnlVector GetMatrixColumn(unsigned int direction) const
Get a VnlVector along bounding-box in the specified direction, length is spacing. ...
virtual void Write() override
Write the base data to the specified location or output stream.
static const char * XML_VERTEX_X
static const char * XML_ORIGIN_Y
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
static const char * XML_VERTEX_LABEL
static const char * XML_FILE_VERSION
static const char * XML_CONNECTOMICS_FILE
static const char * XML_EDGE_TARGET_ID
static const char * XML_VERTICES
std::vector< std::pair< std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode >, mitk::ConnectomicsNetwork::NetworkEdge > > EdgeVectorType
static const char * XML_MATRIX_YX
static const char * GetStaticNameOfClass()
static const char * XML_MATRIX_YZ
static const char * XML_VERTEX_Y
static const char * XML_GEOMETRY
static const char * XML_SPACING_Y
static const char * XML_SPACING_X
static const char * XML_EDGE_WEIGHT_ID
us::ServiceRegistration< IFileWriter > RegisterService(us::ModuleContext *context=us::GetModuleContext())
static const char * VERSION_STRING
static const char * XML_EDGE_ID
static const char * XML_EDGE
static const char * XML_ORIGIN_Z
static const char * XML_SPACING_Z
Base class for writing mitk::BaseData objects to files or streams.
Connectomics Network Class.
std::vector< mitk::ConnectomicsNetwork::NetworkNode > VertexVectorType
static const char * XML_EDGE_SOURCE_ID
virtual mitk::ConnectomicsNetworkWriter * Clone() const override
BaseGeometry Describes the geometry of a data object.
static const char * XML_MATRIX_XY
static const char * XML_VERTEX