SIVIC API
0.9.26
|
#include <svkDataAcquisitionDescriptionXML.h>
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]) |
svkSatBandsXML * | GetSatBandsXML () |
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 () | |
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:
The 'trajectory' element would be found at the path 'encoding/trajectory'.
|
protected |
|
protected |
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.
parentPath | the xpath to the parent element |
name | the name of the element to add |
References svkXMLUtils::CreateNestedXMLDataElement(), and svkDataAcquisitionDescriptionXML::FindNestedElementWithPath().
void ClearXMLFile | ( | ) |
Deletes the internal XML objects.
Referenced by svkDataAcquisitionDescriptionXML::InitializeEmptyXMLFile(), and svkDataAcquisitionDescriptionXML::SetXMLFileName().
vtkXMLDataElement * FindNestedElementWithPath | ( | string | xmlPath | ) |
Finds an xml element. Reports an error and returns null if nothing is found at the given xpath.
xmlPath | the xpath to the element |
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.
xmlPath | the xpath to the element |
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.
svkSatBandsXML * GetSatBandsXML | ( | ) |
Get the internal svk::svkSatBandsXML object.
Referenced by svkDataAcquisitionDescriptionXML_GetSatBandsXML().
vtkstd::string GetTrajectoryComment | ( | ) |
Get 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.
name | the name of the user parameter |
References svkTypeUtils::StringToDouble().
vtkstd::string GetTrajectoryID | ( | ) |
Get 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.
name | the name of the user parameter |
References svkTypeUtils::StringToLInt().
vtkstd::string GetTrajectoryType | ( | ) |
Get the contents of the encoding/trajectory element.
References svkDataAcquisitionDescriptionXML::GetDataWithPath().
string GetXMLFileName | ( | ) |
Get the path to the current XML file.
int GetXMLVersion | ( | ) |
Get 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 |
Referenced by svkDataAcquisitionDescriptionXML_New(), and svkDataAcquisitionDescriptionXML_Read().
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.
parentPath | the xpath to the parent element |
name | the name of the element to remove |
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.
xmlPath | the xpath to the element |
value | the value to set into the element at the given path |
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.
comment | the 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.
ID | the 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.
name | the of the new user parameter element |
value | the 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.
name | the of the new user parameter element |
value | the 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.
type | the desired contents of the encoding/trajectory element |
References svkDataAcquisitionDescriptionXML::SetDataWithPath().
void SetVerbose | ( | bool | isVerbose | ) |
Set the verbose flag.
verbose | boolean flag |
int SetXMLFileName | ( | vtkstd::string | xmlFileName | ) |
Set the path/name to an xml file, parse the file and initialize the object.
xmlFileName | the path of the file to be read |
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.
xmlFileName | target file name to be written to |
References svkFileUtils::FilePathExists().