From 065d9c6a18f2b8eececc608ce850a9a308ca6356 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Wed, 25 Feb 2015 16:46:09 +0100 Subject: get_geometry now uses XML config object (for volumes) --- include/astra/Config.h | 3 +++ include/astra/VolumeGeometry2D.h | 6 ++++++ include/astra/VolumeGeometry3D.h | 6 ++++++ include/astra/XMLDocument.h | 3 +++ 4 files changed, 18 insertions(+) (limited to 'include/astra') diff --git a/include/astra/Config.h b/include/astra/Config.h index 647462b..9893c90 100644 --- a/include/astra/Config.h +++ b/include/astra/Config.h @@ -31,6 +31,7 @@ $Id$ #include "Globals.h" #include "XMLNode.h" +#include "XMLDocument.h" #include @@ -46,6 +47,8 @@ struct _AstraExport Config { Config(XMLNode* _self); ~Config(); + void initialize(std::string rootname); + XMLNode* self; XMLNode* global; }; diff --git a/include/astra/VolumeGeometry2D.h b/include/astra/VolumeGeometry2D.h index fa0528d..28703d5 100644 --- a/include/astra/VolumeGeometry2D.h +++ b/include/astra/VolumeGeometry2D.h @@ -205,6 +205,12 @@ public: */ virtual bool isEqual(CVolumeGeometry2D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Get the number of columns in the volume grid. * * @return Number of columns in the volume grid. diff --git a/include/astra/VolumeGeometry3D.h b/include/astra/VolumeGeometry3D.h index d5c8fff..ff94844 100644 --- a/include/astra/VolumeGeometry3D.h +++ b/include/astra/VolumeGeometry3D.h @@ -246,6 +246,12 @@ public: */ virtual bool isEqual(const CVolumeGeometry3D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Get the number of columns in the volume grid. * * @return Number of columns in the volume grid. diff --git a/include/astra/XMLDocument.h b/include/astra/XMLDocument.h index c6f1b9a..869e1a3 100644 --- a/include/astra/XMLDocument.h +++ b/include/astra/XMLDocument.h @@ -86,6 +86,9 @@ public: */ void saveToFile(string sFilename); + /** convert and XML DOM tree to a string + */ + std::string toString(); private: -- cgit v1.2.3 From cca150841cd1de4f3b4d24c1188263b9623bc511 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 13:47:59 +0100 Subject: get_geometry now uses XML config object (for projections) --- include/astra/ConeProjectionGeometry3D.h | 6 ++++++ include/astra/ConeVecProjectionGeometry3D.h | 6 ++++++ include/astra/FanFlatProjectionGeometry2D.h | 6 ++++++ include/astra/FanFlatVecProjectionGeometry2D.h | 7 +++++++ include/astra/ParallelProjectionGeometry2D.h | 6 ++++++ include/astra/ParallelProjectionGeometry3D.h | 6 ++++++ include/astra/ParallelVecProjectionGeometry3D.h | 6 ++++++ include/astra/ProjectionGeometry2D.h | 6 ++++++ include/astra/ProjectionGeometry3D.h | 6 ++++++ include/astra/SparseMatrixProjectionGeometry2D.h | 8 +++++++- 10 files changed, 62 insertions(+), 1 deletion(-) (limited to 'include/astra') diff --git a/include/astra/ConeProjectionGeometry3D.h b/include/astra/ConeProjectionGeometry3D.h index 2a0474d..6257f7e 100644 --- a/include/astra/ConeProjectionGeometry3D.h +++ b/include/astra/ConeProjectionGeometry3D.h @@ -148,6 +148,12 @@ public: */ virtual bool isEqual(const CProjectionGeometry3D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Returns true if the type of geometry defined in this class is the one specified in _sType. * * @param _sType geometry type to compare to. diff --git a/include/astra/ConeVecProjectionGeometry3D.h b/include/astra/ConeVecProjectionGeometry3D.h index 68a80ef..0330066 100644 --- a/include/astra/ConeVecProjectionGeometry3D.h +++ b/include/astra/ConeVecProjectionGeometry3D.h @@ -128,6 +128,12 @@ public: */ virtual bool isEqual(const CProjectionGeometry3D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Returns true if the type of geometry defined in this class is the one specified in _sType. * * @param _sType geometry type to compare to. diff --git a/include/astra/FanFlatProjectionGeometry2D.h b/include/astra/FanFlatProjectionGeometry2D.h index 8f22c35..180fe68 100644 --- a/include/astra/FanFlatProjectionGeometry2D.h +++ b/include/astra/FanFlatProjectionGeometry2D.h @@ -140,6 +140,12 @@ public: */ virtual bool isOfType(const std::string& _sType); + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Return true if this geometry instance is the same as the one specified. * * @return true if this geometry instance is the same as the one specified. diff --git a/include/astra/FanFlatVecProjectionGeometry2D.h b/include/astra/FanFlatVecProjectionGeometry2D.h index 85c994f..825bcbc 100644 --- a/include/astra/FanFlatVecProjectionGeometry2D.h +++ b/include/astra/FanFlatVecProjectionGeometry2D.h @@ -126,6 +126,13 @@ public: */ virtual bool isEqual(CProjectionGeometry2D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + + /** Get the value for t and theta, based upon the row and column index. * * @param _iRow row index diff --git a/include/astra/ParallelProjectionGeometry2D.h b/include/astra/ParallelProjectionGeometry2D.h index ed9d228..2f7d36f 100644 --- a/include/astra/ParallelProjectionGeometry2D.h +++ b/include/astra/ParallelProjectionGeometry2D.h @@ -136,6 +136,12 @@ public: */ virtual bool isOfType(const std::string& _sType); + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** * Returns a vector describing the direction of a ray belonging to a certain detector, * the direction is the same for all detectors in one projection diff --git a/include/astra/ParallelProjectionGeometry3D.h b/include/astra/ParallelProjectionGeometry3D.h index da60617..aa93a29 100644 --- a/include/astra/ParallelProjectionGeometry3D.h +++ b/include/astra/ParallelProjectionGeometry3D.h @@ -129,6 +129,12 @@ public: */ virtual bool isEqual(const CProjectionGeometry3D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Returns true if the type of geometry defined in this class is the one specified in _sType. * * @param _sType geometry type to compare to. diff --git a/include/astra/ParallelVecProjectionGeometry3D.h b/include/astra/ParallelVecProjectionGeometry3D.h index fbc2112..f3ed949 100644 --- a/include/astra/ParallelVecProjectionGeometry3D.h +++ b/include/astra/ParallelVecProjectionGeometry3D.h @@ -128,6 +128,12 @@ public: */ virtual bool isEqual(const CProjectionGeometry3D*) const; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + /** Returns true if the type of geometry defined in this class is the one specified in _sType. * * @param _sType geometry type to compare to. diff --git a/include/astra/ProjectionGeometry2D.h b/include/astra/ProjectionGeometry2D.h index 303ca0a..b8324e2 100644 --- a/include/astra/ProjectionGeometry2D.h +++ b/include/astra/ProjectionGeometry2D.h @@ -157,6 +157,12 @@ public: */ virtual bool isEqual(CProjectionGeometry2D*) const = 0; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const = 0; + /** Get the number of projection angles. * * @return Number of projection angles diff --git a/include/astra/ProjectionGeometry3D.h b/include/astra/ProjectionGeometry3D.h index 41b1cb7..b6e63a8 100644 --- a/include/astra/ProjectionGeometry3D.h +++ b/include/astra/ProjectionGeometry3D.h @@ -187,6 +187,12 @@ public: */ virtual bool isEqual(const CProjectionGeometry3D *) const = 0; + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const = 0; + /** Get the number of projections. * * @return Number of projections diff --git a/include/astra/SparseMatrixProjectionGeometry2D.h b/include/astra/SparseMatrixProjectionGeometry2D.h index 36964be..d56f95e 100644 --- a/include/astra/SparseMatrixProjectionGeometry2D.h +++ b/include/astra/SparseMatrixProjectionGeometry2D.h @@ -103,7 +103,6 @@ public: * @param _pMatrix Pointer to a CSparseMatrix. The caller is responsible for keeping this matrix valid until it is no longer required. * @return initialization successful? */ - bool setMatrix(CSparseMatrix* _pMatrix); /** Get a pointer to the associated sparse matrix. @@ -128,6 +127,13 @@ public: */ virtual bool isOfType(const std::string& _sType); + /** Get all settings in a Config object. + * + * @return Configuration Object. + */ + virtual Config* getConfiguration() const; + + /** * Returns a vector describing the direction of a ray belonging to a certain detector * -- cgit v1.2.3 From 2d11dcfc8d85cd562a36c192f5dda64c8378d160 Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 14:00:14 +0100 Subject: updated docs --- include/astra/ConeProjectionGeometry3D.h | 14 ++++---------- include/astra/ConeVecProjectionGeometry3D.h | 8 +------- include/astra/FanFlatVecProjectionGeometry2D.h | 9 +++++++++ include/astra/ParallelProjectionGeometry3D.h | 14 ++++---------- include/astra/ParallelVecProjectionGeometry3D.h | 8 +------- include/astra/ProjectionGeometry3D.h | 6 ------ 6 files changed, 19 insertions(+), 40 deletions(-) (limited to 'include/astra') diff --git a/include/astra/ConeProjectionGeometry3D.h b/include/astra/ConeProjectionGeometry3D.h index 6257f7e..00e72ce 100644 --- a/include/astra/ConeProjectionGeometry3D.h +++ b/include/astra/ConeProjectionGeometry3D.h @@ -40,8 +40,8 @@ namespace astra * \par XML Configuration * \astra_xml_item{DetectorRowCount, int, Number of detectors for each projection.} * \astra_xml_item{DetectorColCount, int, Number of detectors for each projection.} - * \astra_xml_item{DetectorWidth, float, Width of each detector.} - * \astra_xml_item{DetectorHeight, float, Width of each detector.} + * \astra_xml_item{DetectorSpacingX, float, Width of each detector.} + * \astra_xml_item{DetectorSpacingY, float, Width of each detector.} * \astra_xml_item{ProjectionAngles, vector of float, projection angles in radians.} * \astra_xml_item{DistanceOriginDetector, float, Distance between the center of rotation and the detectorarray.} * \astra_xml_item{DistanceOriginSource, float, Distance between the center of rotation the the x-ray source.} @@ -51,8 +51,8 @@ namespace astra * proj_geom = astra_struct('cone');\n * proj_geom.DetectorRowCount = 512;\n * proj_geom.DetectorColCount = 512;\n - * proj_geom.DetectorWidth = 1.0;\n - * proj_geom.DetectorHeight = 1.0;\n + * proj_geom.DetectorSpacingX = 1.0;\n + * proj_geom.DetectorSpacingY = 1.0;\n * proj_geom.ProjectionAngles = linspace(0,pi,100);\n * proj_geom.DistanceOriginDetector = 10000;\n * proj_geom.DistanceOriginSource = 10000;\n @@ -161,12 +161,6 @@ public: */ virtual bool isOfType(const std::string& _sType) const; - /** Turn this object into an XML object. - * - * @param _sNode The XML object to fill. - */ - virtual void toXML(XMLNode* _sNode) const; - /** Returns the distance from the origin of the coordinate system to the source. * * @return Distance from the origin of the coordinate system to the source diff --git a/include/astra/ConeVecProjectionGeometry3D.h b/include/astra/ConeVecProjectionGeometry3D.h index 0330066..e82a411 100644 --- a/include/astra/ConeVecProjectionGeometry3D.h +++ b/include/astra/ConeVecProjectionGeometry3D.h @@ -56,7 +56,7 @@ namespace astra * to a single projection, and consists of: * ( srcX, srcY, srcZ, dX, dY, dZ, uX, uY, uZ, vX, vY, vZ ) * src: the ray source - * d : the corner of the detector + * d : the centre of the detector plane * u : the vector from detector pixel (0,0) to (0,1) * v : the vector from detector pixel (0,0) to (1,0) */ @@ -141,12 +141,6 @@ public: */ virtual bool isOfType(const std::string& _sType) const; - /** Turn this object into an XML object. - * - * @param _sNode The XML object to fill. - */ - virtual void toXML(XMLNode* _sNode) const; - /** * Returns a vector giving the projection direction for a projection and detector index */ diff --git a/include/astra/FanFlatVecProjectionGeometry2D.h b/include/astra/FanFlatVecProjectionGeometry2D.h index 825bcbc..583e886 100644 --- a/include/astra/FanFlatVecProjectionGeometry2D.h +++ b/include/astra/FanFlatVecProjectionGeometry2D.h @@ -53,6 +53,15 @@ namespace astra * proj_geom.DetectorCount = 512;\n * proj_geom.Vectors = V;\n * } + * + * \par Vectors + * Vectors is a matrix containing the actual geometry. Each row corresponds + * to a single projection, and consists of: + * ( srcX, srcY, srcZ, dX, dY uX, uY) + * src: the ray source + * d : the centre of the detector array + * u : the vector from detector 0 to detector 1 + */ */ class _AstraExport CFanFlatVecProjectionGeometry2D : public CProjectionGeometry2D { diff --git a/include/astra/ParallelProjectionGeometry3D.h b/include/astra/ParallelProjectionGeometry3D.h index aa93a29..72401e5 100644 --- a/include/astra/ParallelProjectionGeometry3D.h +++ b/include/astra/ParallelProjectionGeometry3D.h @@ -41,8 +41,8 @@ namespace astra * \par XML Configuration * \astra_xml_item{DetectorRowCount, int, Number of detectors for each projection.} * \astra_xml_item{DetectorColCount, int, Number of detectors for each projection.} - * \astra_xml_item{DetectorWidth, float, Width of each detector.} - * \astra_xml_item{DetectorHeight, float, Width of each detector.} + * \astra_xml_item{DetectorSpacingX, float, Width of each detector.} + * \astra_xml_item{DetectorSpacingY, float, Width of each detector.} * \astra_xml_item{ProjectionAngles, vector of float, projection angles in radians.} * * \par MATLAB example @@ -50,8 +50,8 @@ namespace astra * proj_geom = astra_struct('parallel');\n * proj_geom.DetectorRowCount = 512;\n * proj_geom.DetectorColCount = 512;\n - * proj_geom.DetectorWidth = 1.0;\n - * proj_geom.DetectorHeight = 1.0;\n + * proj_geom.DetectorSpacingX = 1.0;\n + * proj_geom.DetectorSpacingY = 1.0;\n * proj_geom.ProjectionAngles = linspace(0,pi,100);\n * } */ @@ -142,12 +142,6 @@ public: */ virtual bool isOfType(const std::string& _sType) const; - /** Turn this object into an XML object. - * - * @param _sNode The XML object to fill. - */ - virtual void toXML(XMLNode* _sNode) const; - /** * Returns a vector giving the projection direction for a projection and detector index */ diff --git a/include/astra/ParallelVecProjectionGeometry3D.h b/include/astra/ParallelVecProjectionGeometry3D.h index f3ed949..5a63249 100644 --- a/include/astra/ParallelVecProjectionGeometry3D.h +++ b/include/astra/ParallelVecProjectionGeometry3D.h @@ -55,7 +55,7 @@ namespace astra * to a single projection, and consists of: * ( rayX, rayY, rayZ, dX, dY, dZ, uX, uY, uZ, vX, vY, vZ ) * ray: the ray direction - * d : the corner of the detector + * d : the centre of the detector plane * u : the vector from detector pixel (0,0) to (0,1) * v : the vector from detector pixel (0,0) to (1,0) */ @@ -141,12 +141,6 @@ public: */ virtual bool isOfType(const std::string& _sType) const; - /** Turn this object into an XML object. - * - * @param _sNode The XML object to fill. - */ - virtual void toXML(XMLNode* _sNode) const; - /** * Returns a vector giving the projection direction for a projection and detector index */ diff --git a/include/astra/ProjectionGeometry3D.h b/include/astra/ProjectionGeometry3D.h index b6e63a8..19ac3ab 100644 --- a/include/astra/ProjectionGeometry3D.h +++ b/include/astra/ProjectionGeometry3D.h @@ -328,12 +328,6 @@ public: */ virtual bool isOfType(const std::string& _sType) const = 0; - /** Turn this object into an XML object. - * - * @param _sNode The XML object to fill. - */ - virtual void toXML(XMLNode* _sNode) const = 0; - /** * Returns a vector giving the projection direction for a projection and detector index */ -- cgit v1.2.3 From 169e912d2633cda7ffc234e78afba1b096e122ea Mon Sep 17 00:00:00 2001 From: Wim van Aarle Date: Thu, 26 Feb 2015 16:11:38 +0100 Subject: code cleanup --- include/astra/FanFlatVecProjectionGeometry2D.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/astra') diff --git a/include/astra/FanFlatVecProjectionGeometry2D.h b/include/astra/FanFlatVecProjectionGeometry2D.h index 583e886..ee85408 100644 --- a/include/astra/FanFlatVecProjectionGeometry2D.h +++ b/include/astra/FanFlatVecProjectionGeometry2D.h @@ -62,7 +62,6 @@ namespace astra * d : the centre of the detector array * u : the vector from detector 0 to detector 1 */ - */ class _AstraExport CFanFlatVecProjectionGeometry2D : public CProjectionGeometry2D { protected: -- cgit v1.2.3