diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-12-16 18:13:33 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-12-16 18:13:33 +0100 |
commit | f1c4c523db55ad31f3cfb8f51113099654c62c00 (patch) | |
tree | 2424d84078e35e6232d732846ccf756280e9a431 | |
parent | 0d015b1c91581ee5ef3e936f03e4c62fbc7ea362 (diff) | |
parent | 823bdc90b6d4ebf5acade43ad909805053c8974e (diff) | |
download | astra-f1c4c523db55ad31f3cfb8f51113099654c62c00.tar.gz astra-f1c4c523db55ad31f3cfb8f51113099654c62c00.tar.bz2 astra-f1c4c523db55ad31f3cfb8f51113099654c62c00.tar.xz astra-f1c4c523db55ad31f3cfb8f51113099654c62c00.zip |
Merge pull request #102 from wjp/misc_fixes
Misc fixes
-rw-r--r-- | include/astra/ParallelBeamLineKernelProjector2D.inl | 4 | ||||
-rw-r--r-- | python/astra/creators.py | 38 | ||||
-rw-r--r-- | src/CudaForwardProjectionAlgorithm.cpp | 1 |
3 files changed, 22 insertions, 21 deletions
diff --git a/include/astra/ParallelBeamLineKernelProjector2D.inl b/include/astra/ParallelBeamLineKernelProjector2D.inl index 199d69e..c11f243 100644 --- a/include/astra/ParallelBeamLineKernelProjector2D.inl +++ b/include/astra/ParallelBeamLineKernelProjector2D.inl @@ -259,7 +259,7 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i else { I = (1.5f - T - x2) / (1.0f - 2.0f*T) * lengthPerCol; - if (x1 >= 0 && x1 < m_pVolumeGeometry->getGridColCount()) { + if (x1 >= 0 && x1 < m_pVolumeGeometry->getGridRowCount()) { iVolumeIndex = m_pVolumeGeometry->pixelRowColToIndex(x1, col); // POLICY: PIXEL PRIOR + ADD + POSTERIOR if (p.pixelPrior(iVolumeIndex)) { @@ -267,7 +267,7 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i p.pixelPosterior(iVolumeIndex); } } - if (x1+1 >= 0 && x1+1 < m_pVolumeGeometry->getGridColCount()) { + if (x1+1 >= 0 && x1+1 < m_pVolumeGeometry->getGridRowCount()) { iVolumeIndex = m_pVolumeGeometry->pixelRowColToIndex(x1+1, col); // POLICY: PIXEL PRIOR + ADD + POSTERIOR if (p.pixelPrior(iVolumeIndex)) { diff --git a/python/astra/creators.py b/python/astra/creators.py index f3474d8..18504ea 100644 --- a/python/astra/creators.py +++ b/python/astra/creators.py @@ -57,23 +57,23 @@ This method can be called in a number of ways: ``create_vol_geom(N)``: :returns: A 2D volume geometry of size :math:`N \\times N`. -``create_vol_geom((M, N))``: - :returns: A 2D volume geometry of size :math:`M \\times N`. +``create_vol_geom((Y, X))``: + :returns: A 2D volume geometry of size :math:`Y \\times X`. -``create_vol_geom(M, N)``: - :returns: A 2D volume geometry of size :math:`M \\times N`. +``create_vol_geom(Y, X)``: + :returns: A 2D volume geometry of size :math:`Y \\times X`. -``create_vol_geom(M, N, minx, maxx, miny, maxy)``: - :returns: A 2D volume geometry of size :math:`M \\times N`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy`. +``create_vol_geom(Y, X, minx, maxx, miny, maxy)``: + :returns: A 2D volume geometry of size :math:`Y \\times X`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy`. -``create_vol_geom((M, N, Z))``: - :returns: A 3D volume geometry of size :math:`M \\times N \\times Z`. +``create_vol_geom((Y, X, Z))``: + :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`. -``create_vol_geom(M, N, Z)``: - :returns: A 3D volume geometry of size :math:`M \\times N \\times Z`. +``create_vol_geom(Y, X, Z)``: + :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`. -``create_vol_geom(M, N, Z, minx, maxx, miny, maxy, minz, maxz)``: - :returns: A 3D volume geometry of size :math:`M \\times N \\times Z`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy` and :math:`minz \\leq z \\leq maxz` . +``create_vol_geom(Y, X, Z, minx, maxx, miny, maxy, minz, maxz)``: + :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy` and :math:`minz \\leq z \\leq maxz` . """ @@ -156,7 +156,7 @@ This method can be called in a number of ways: :returns: A parallel projection geometry. -``create_proj_geom('fanflat', det_width, det_count, angles, source_origin, source_det)``: +``create_proj_geom('fanflat', det_width, det_count, angles, source_origin, origin_det)``: :param det_width: Size of a detector pixel. :type det_width: :class:`float` @@ -165,7 +165,7 @@ This method can be called in a number of ways: :param angles: Array of angles in radians. :type angles: :class:`numpy.ndarray` :param source_origin: Position of the source. -:param source_det: Position of the detector +:param origin_det: Position of the detector :returns: A fan-beam projection geometry. ``create_proj_geom('fanflat_vec', det_count, V)``: @@ -188,7 +188,7 @@ This method can be called in a number of ways: :type angles: :class:`numpy.ndarray` :returns: A parallel projection geometry. -``create_proj_geom('cone', detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, source_det)``: +``create_proj_geom('cone', detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, origin_det)``: :param detector_spacing_*: Distance between two adjacent detector pixels. :type detector_spacing_*: :class:`float` @@ -200,8 +200,8 @@ This method can be called in a number of ways: :type angles: :class:`numpy.ndarray` :param source_origin: Distance between point source and origin. :type source_origin: :class:`float` -:param source_det: Distance between the detector and origin. -:type source_det: :class:`float` +:param origin_det: Distance between the detector and origin. +:type origin_det: :class:`float` :returns: A cone-beam projection geometry. ``create_proj_geom('cone_vec', det_row_count, det_col_count, V)``: @@ -244,7 +244,7 @@ This method can be called in a number of ways: return {'type': 'parallel', 'DetectorWidth': args[0], 'DetectorCount': args[1], 'ProjectionAngles': args[2]} elif intype == 'fanflat': if len(args) < 5: - raise Exception('not enough variables: astra_create_proj_geom(fanflat, det_width, det_count, angles, source_origin, source_det)') + raise Exception('not enough variables: astra_create_proj_geom(fanflat, det_width, det_count, angles, source_origin, origin_det)') return {'type': 'fanflat', 'DetectorWidth': args[0], 'DetectorCount': args[1], 'ProjectionAngles': args[2], 'DistanceOriginSource': args[3], 'DistanceOriginDetector': args[4]} elif intype == 'fanflat_vec': if len(args) < 2: @@ -258,7 +258,7 @@ This method can be called in a number of ways: return {'type':'parallel3d', 'DetectorSpacingX':args[0], 'DetectorSpacingY':args[1], 'DetectorRowCount':args[2], 'DetectorColCount':args[3],'ProjectionAngles':args[4]} elif intype == 'cone': if len(args) < 7: - raise Exception('not enough variables: astra_create_proj_geom(cone, detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, source_det)') + raise Exception('not enough variables: astra_create_proj_geom(cone, detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, origin_det)') return {'type': 'cone','DetectorSpacingX':args[0], 'DetectorSpacingY':args[1], 'DetectorRowCount':args[2],'DetectorColCount':args[3],'ProjectionAngles':args[4],'DistanceOriginSource': args[5],'DistanceOriginDetector':args[6]} elif intype == 'cone_vec': if len(args) < 3: diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index 9ca13ae..d38469c 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -94,6 +94,7 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) ConfigStackCheck<CAlgorithm> CC("CudaForwardProjectionAlgorithm", this, _cfg); // Projector + m_pProjector = 0; XMLNode node = _cfg.self.getSingleNode("ProjectorId"); if (node) { int id = boost::lexical_cast<int>(node.getContent()); |