X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fprojections.h;fp=include%2Fprojections.h;h=9e64f260d49fd9da53e39468223900565053e625;hb=d850a3477e9ccaecfa85e00bc619848fcc29bdb6;hp=39cb09a7a67446a3723a7cb06a6921bc6ddc68a7;hpb=b361677a2f7d5b443641faec70b057f2a84dc77e;p=ctsim.git diff --git a/include/projections.h b/include/projections.h index 39cb09a..9e64f26 100644 --- a/include/projections.h +++ b/include/projections.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: projections.h,v 1.28 2001/03/10 23:14:15 kevin Exp $ +** $Id: projections.h,v 1.29 2001/03/10 23:56:58 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -37,6 +37,8 @@ class fnetorderstream; #include "array2dfile.h" #include "imagefile.h" #include +#include + //used for rebinning divergent beam projections to parallel class ParallelRaysumCoordinate { @@ -50,20 +52,34 @@ public: {return m_dT < rCompare.m_dT; } bool lessThanTheta (ParallelRaysumCoordinate& rCompare) {return m_dTheta < rCompare.m_dTheta; } + + static compareByTheta(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b) + { return a->m_dTheta > b->m_dTheta; } + + static compareByT(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b) + { return a->m_dT > b->m_dT; } + }; class ParallelRaysums { -private: - ParallelRaysumCoordinate** m_ppCoordinates; - int m_iNumCoordinates; - public: ParallelRaysums (Projections* pProjections); ~ParallelRaysums (); - ParallelRaysumCoordinate** getCoordinates() {return m_ppCoordinates;} + typedef std::vector CoordinateContainer; + typedef CoordinateContainer::iterator CoordinateIterator; + + CoordinateContainer& getCoordinates() {return m_vecpCoordinates;} int getNumCoordinates() const {return m_iNumCoordinates;} void getLimits (double* dMinT, double* dMaxT, double* dMinTheta, double* dMaxTheta) const; + CoordinateContainer& getSortedByT(); + CoordinateContainer& getSortedByTheta(); + +private: + CoordinateContainer m_vecpCoordinates; + CoordinateContainer m_vecpSortedByT; + CoordinateContainer m_vecpSortedByTheta; + int m_iNumCoordinates; };