SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
svkDataAcquisitionDescriptionXML Class Reference

#include <svkDataAcquisitionDescriptionXML.h>

Inheritance diagram for svkDataAcquisitionDescriptionXML:

Public Member Functions

 vtkTypeMacro (svkDataAcquisitionDescriptionXML, vtkObject)
 
int SetXMLFileName (vtkstd::string xmlFileName)
 
vtkstd::string GetXMLFileName ()
 
void ClearXMLFile ()
 
void InitializeEmptyXMLFile ()
 
void SetVerbose (bool isVerbose)
 
int GetXMLVersion ()
 
vtkXMLDataElement * FindNestedElementWithPath (string xmlPath)
 
const char * GetDataWithPath (const char *xmlPath)
 
int SetDataWithPath (const char *xmlPath, const char *value)
 
vtkXMLDataElement * AddElementWithParentPath (const char *xmlPath, const char *name)
 
int RemoveElementWithParentPath (const char *xmlPath, const char *name)
 
vtkXMLDataElement * GetRootXMLDataElement ()
 
void GetEncodedSpace (int matrixSize[3], float fov[3])
 
svkSatBandsXMLGetSatBandsXML ()
 
void SetTrajectoryType (vtkstd::string type)
 
vtkstd::string GetTrajectoryType ()
 
void SetTrajectoryID (vtkstd::string ID)
 
vtkstd::string GetTrajectoryID ()
 
void SetTrajectoryComment (vtkstd::string comment)
 
vtkstd::string GetTrajectoryComment ()
 
void SetTrajectoryParameter (vtkstd::string name, long value)
 
long GetTrajectoryLongParameter (vtkstd::string name)
 
void SetTrajectoryParameter (vtkstd::string name, double value)
 
double GetTrajectoryDoubleParameter (vtkstd::string name)
 
int WriteXMLFile (string xmlFileName)
 

Static Public Member Functions

static
svkDataAcquisitionDescriptionXML
New ()
 

Protected Member Functions

 svkDataAcquisitionDescriptionXML ()
 
 ~svkDataAcquisitionDescriptionXML ()
 

Detailed Description

Class to manage IO for XML data acquisition description files. These files are intended to be used to describe acquisitions in such a way that when they are coupled with a raw data file they can be used to determine all necessary information to reconstruct the data. Our initial development will be to use an XML format on the ISMRMRD XML header. Details of the ISMRMRD can be found here: http://ismrmrd.github.io/

This class uses XML path (xpath) style notation for referencing specific elements. Currently only the most basic syntax is supported which is to refer to an element by its location which is defined as a '/' separated list of all parent elements followed by the element itself. For example if you had the following xml data:

<encoding>
<trajectory>cartesian</trajectory>
</encoding>

The 'trajectory' element would be found at the path 'encoding/trajectory'.

Constructor & Destructor Documentation

Member Function Documentation

vtkXMLDataElement * AddElementWithParentPath ( const char *  parentPath,
const char *  name 
)

Adds an xml data element. Note the xmlPath is of the parent where you wish to add the named element.

Parameters
parentPaththe xpath to the parent element
namethe name of the element to add

References svkXMLUtils::CreateNestedXMLDataElement(), and svkDataAcquisitionDescriptionXML::FindNestedElementWithPath().

void ClearXMLFile ( )
vtkXMLDataElement * FindNestedElementWithPath ( string  xmlPath)

Finds an xml element. Reports an error and returns null if nothing is found at the given xpath.

Parameters
xmlPaththe xpath to the element
Returns
the element or NULL if not found

References svkXMLUtils::FindNestedElementWithPath().

Referenced by svkDataAcquisitionDescriptionXML::AddElementWithParentPath(), and svkDataAcquisitionDescriptionXML::RemoveElementWithParentPath().

const char * GetDataWithPath ( const char *  xmlPath)

Returns the character data at a specific path. Reports an error if the path is not found.

Parameters
xmlPaththe xpath to the element
Returns
the contents of the element at the given path

References svkXMLUtils::GetNestedElementCharacterDataWithPath().

Referenced by svkDataAcquisitionDescriptionXML::GetTrajectoryComment(), svkDataAcquisitionDescriptionXML::GetTrajectoryID(), and svkDataAcquisitionDescriptionXML::GetTrajectoryType().

void GetEncodedSpace ( int  matrixSize[3],
float  fov[3] 
)
vtkXMLDataElement * GetRootXMLDataElement ( )

Get the root XML data object.

Returns
the root XML data object.
svkSatBandsXML * GetSatBandsXML ( )

Get the internal svk::svkSatBandsXML object.

Returns
the internal svk::svkSatBandsXML object

Referenced by svkDataAcquisitionDescriptionXML_GetSatBandsXML().

vtkstd::string GetTrajectoryComment ( )

Get the contents of the encoding/trajectoryDescription/comment element.

Returns
the contents of the encoding/trajectoryDescription/comment element

References svkDataAcquisitionDescriptionXML::GetDataWithPath().

double GetTrajectoryDoubleParameter ( vtkstd::string  name)

Gets the contents of an encoding/trajectoryDescription/userParameterDouble element.

Parameters
namethe name of the user parameter
Returns
the value of the user parameter

References svkTypeUtils::StringToDouble().

vtkstd::string GetTrajectoryID ( )

Get the contents of the encoding/trajectoryDescription/identifier element.

Returns
the contents of the encoding/trajectoryDescription/identifier element

References svkDataAcquisitionDescriptionXML::GetDataWithPath().

long GetTrajectoryLongParameter ( vtkstd::string  name)

Gets the contents of an encoding/trajectoryDescription/userParameterLong element.

Parameters
namethe name of the user parameter
Returns
the value of the user parameter

References svkTypeUtils::StringToLInt().

vtkstd::string GetTrajectoryType ( )

Get the contents of the encoding/trajectory element.

Returns
the contents of the encoding/trajectory element

References svkDataAcquisitionDescriptionXML::GetDataWithPath().

string GetXMLFileName ( )

Get the path to the current XML file.

Returns
the path to the current xml file;
int GetXMLVersion ( )

Get the version of the xml file

Returns
the version of the xml file
void InitializeEmptyXMLFile ( )

Initialize the skeleton of the xml file. This will create the following elements: svk_data_acquisition_description svk_data_acquisition_description/version svk_data_acquisition_description/encoding svk_data_acquisition_description/encoding/trajectory svk_data_acquisition_description/encoding/trajectoryDescription svk_data_acquisition_description/encoding/trajectoryDescription/identifier svk_data_acquisition_description/encoding/trajectoryDescription/comment svk_data_acquisition_description/encoding/encodedSpace svk_data_acquisition_description/encoding/encodedSpace/matrixSize svk_data_acquisition_description/encoding/encodedSpace/matrixSize/x svk_data_acquisition_description/encoding/encodedSpace/matrixSize/y svk_data_acquisition_description/encoding/encodedSpace/matrixSize/z svk_data_acquisition_description/encoding/encodedSpace/fieldOfView_mm/x svk_data_acquisition_description/encoding/encodedSpace/fieldOfView_mm/y svk_data_acquisition_description/encoding/encodedSpace/fieldOfView_mm/z

References svkDataAcquisitionDescriptionXML::ClearXMLFile(), svkXMLUtils::CreateNestedXMLDataElement(), and XML_VERSION.

Referenced by svkDataAcquisitionDescriptionXML_New().

static svkDataAcquisitionDescriptionXML* New ( )
static
int RemoveElementWithParentPath ( const char *  parentPath,
const char *  name 
)

Remove an xml data element. Note the xmlPath is of the parent where you wish to add the named element.

Parameters
parentPaththe xpath to the parent element
namethe name of the element to remove
Returns
0 on success otherwise -1

References svkDataAcquisitionDescriptionXML::FindNestedElementWithPath().

int SetDataWithPath ( const char *  xmlPath,
const char *  value 
)

Sets the character data for an xml element. Reports an error and returns null if nothing is found at the given xpath.

Parameters
xmlPaththe xpath to the element
valuethe value to set into the element at the given path
Returns
0 on success otherwise -1

References svkXMLUtils::SetNestedElementWithPath().

Referenced by svkDataAcquisitionDescriptionXML::SetTrajectoryComment(), svkDataAcquisitionDescriptionXML::SetTrajectoryID(), and svkDataAcquisitionDescriptionXML::SetTrajectoryType().

void SetTrajectoryComment ( vtkstd::string  comment)

Sets the contents of the encoding/trajectoryDescription/comment element.

Parameters
commentthe desired contents of the encoding/trajectoryDescription/comment element

References svkDataAcquisitionDescriptionXML::SetDataWithPath().

void SetTrajectoryID ( vtkstd::string  ID)

Sets the contents of the encoding/trajectoryDescription/identifier element.

Parameters
IDthe desired contents of the encoding/trajectoryDescription/identifier element

References svkDataAcquisitionDescriptionXML::SetDataWithPath().

void SetTrajectoryParameter ( vtkstd::string  name,
long  value 
)

Creates a new encoding/trajectoryDescription/userParameterLong element and creates its child elements 'name' and 'value' with the given values.

Parameters
namethe of the new user parameter element
valuethe value of the new user parameter

References svkTypeUtils::IntToString().

Referenced by svkDataAcquisitionDescriptionXML::SetTrajectoryParameter().

void SetTrajectoryParameter ( vtkstd::string  name,
double  value 
)

Creates a new encoding/trajectoryDescription/userParameterDouble element and creates its child elements 'name' and 'value' with the given values.

Parameters
namethe of the new user parameter element
valuethe value of the new user parameter

References svkTypeUtils::DoubleToString(), and svkDataAcquisitionDescriptionXML::SetTrajectoryParameter().

void SetTrajectoryType ( vtkstd::string  type)

Sets the contents of the encoding/trajectory element.

Parameters
typethe desired contents of the encoding/trajectory element

References svkDataAcquisitionDescriptionXML::SetDataWithPath().

void SetVerbose ( bool  isVerbose)

Set the verbose flag.

Parameters
verboseboolean flag
int SetXMLFileName ( vtkstd::string  xmlFileName)

Set the path/name to an xml file, parse the file and initialize the object.

Parameters
xmlFileNamethe path of the file to be read
Returns
0 for success

References svkDataAcquisitionDescriptionXML::ClearXMLFile(), svkFileUtils::FilePathExists(), svkSatBandsXML::New(), svkSatBandsXML::ParseXML(), and svkTypeUtils::StringToFloat().

Referenced by svkDataAcquisitionDescriptionXML_Read().

vtkTypeMacro ( svkDataAcquisitionDescriptionXML  ,
vtkObject   
)
int WriteXMLFile ( string  xmlFileName)

Write out the internal XML object to file.

Parameters
xmlFileNametarget file name to be written to
Returns
0 on success otherwise -1

References svkFileUtils::FilePathExists().


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