Skip to content

Commit

Permalink
Simple style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed May 18, 2015
1 parent 2d0b4ec commit 5be3b1e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 35 deletions.
64 changes: 30 additions & 34 deletions code/rtkElektaXVI5GeometryXMLFile.cxx
Expand Up @@ -16,9 +16,6 @@
*
*=========================================================================*/

#ifndef _rtkElektaXVI5GeometryXMLFile_cxx
#define _rtkElektaXVI5GeometryXMLFile_cxx

#include "rtkElektaXVI5GeometryXMLFile.h"

#include <itksys/SystemTools.hxx>
Expand All @@ -31,7 +28,7 @@ namespace rtk
{

ElektaXVI5GeometryXMLFileReader::
ElektaXVI5GeometryXMLFileReader() :
ElektaXVI5GeometryXMLFileReader() :
m_Geometry(GeometryType::New() ),
m_CurCharacterData(""),
m_InPlaneAngle(0.),
Expand Down Expand Up @@ -76,37 +73,37 @@ StartElement(const char * itkNotUsed(name))
void
ElektaXVI5GeometryXMLFileReader::
EndElement(const char *name)
{
if (itksys::SystemTools::Strucmp(name, "GantryAngle") == 0 ||
itksys::SystemTools::Strucmp(name, "Angle") == 0) // Second one for backward compatibility
{
m_GantryAngle = atof(this->m_CurCharacterData.c_str());
if (m_GantryAngle < 0)
m_GantryAngle = m_GantryAngle + 360.0;
}
//Regarding PanelOffset, XVI5 specifies position of the center(UCentre, VCentre) instead of offset.
//Therefore, negation is required to get classical m_ProjectionOffsetX and m_ProjectionOffsetY values.
if (itksys::SystemTools::Strucmp(name, "UCentre") == 0)
m_ProjectionOffsetX = atof(this->m_CurCharacterData.c_str()) * -1.0;
{
if (itksys::SystemTools::Strucmp(name, "GantryAngle") == 0 ||
itksys::SystemTools::Strucmp(name, "Angle") == 0) // Second one for backward compatibility
{
m_GantryAngle = atof(this->m_CurCharacterData.c_str());
if (m_GantryAngle < 0)
m_GantryAngle = m_GantryAngle + 360.0;
}

//Regarding PanelOffset, XVI5 specifies position of the center(UCentre, VCentre) instead of offset.
//Therefore, negation is required to get classical m_ProjectionOffsetX and m_ProjectionOffsetY values.
if (itksys::SystemTools::Strucmp(name, "UCentre") == 0)
m_ProjectionOffsetX = atof(this->m_CurCharacterData.c_str()) * -1.0;

if (itksys::SystemTools::Strucmp(name, "VCentre") == 0)
{
m_ProjectionOffsetY = atof(this->m_CurCharacterData.c_str()) * -1.0;
}
if (itksys::SystemTools::Strucmp(name, "VCentre") == 0)
{
m_ProjectionOffsetY = atof(this->m_CurCharacterData.c_str()) * -1.0;
}

if (itksys::SystemTools::Strucmp(name, "Frame") == 0)
{
this->m_OutputObject->AddProjection(m_SourceToIsocenterDistance,
m_SourceToDetectorDistance,
m_GantryAngle,
m_ProjectionOffsetX,
m_ProjectionOffsetY,
m_OutOfPlaneAngle,
m_InPlaneAngle,
m_SourceOffsetX,
m_SourceOffsetY);
}
if (itksys::SystemTools::Strucmp(name, "Frame") == 0)
{
this->m_OutputObject->AddProjection(m_SourceToIsocenterDistance,
m_SourceToDetectorDistance,
m_GantryAngle,
m_ProjectionOffsetX,
m_ProjectionOffsetY,
m_OutOfPlaneAngle,
m_InPlaneAngle,
m_SourceOffsetX,
m_SourceOffsetY);
}
}

void
Expand All @@ -118,4 +115,3 @@ CharacterDataHandler(const char *inData, int inLength)
}

}
#endif
2 changes: 1 addition & 1 deletion code/rtkElektaXVI5GeometryXMLFile.h
Expand Up @@ -47,7 +47,7 @@ class RTK_EXPORT ElektaXVI5GeometryXMLFileReader :
{
public:
/** Standard typedefs */
typedef ElektaXVI5GeometryXMLFileReader Self;
typedef ElektaXVI5GeometryXMLFileReader Self;
typedef itk::XMLReader< ThreeDCircularProjectionGeometry > Superclass;
typedef itk::SmartPointer<Self> Pointer;

Expand Down

0 comments on commit 5be3b1e

Please sign in to comment.