33 #ifndef ROI_LABELNAMING_ACTION_H 34 #define ROI_LABELNAMING_ACTION_H 50 class RoiLabelNamingActionView_Private ;
58 virtual std::string
name()
const;
69 std::cout <<
"Setting label naming mode to 2D" << std::endl ;
73 std::cout <<
"Setting label naming mode to 3D" << std::endl ;
80 std::list< std::pair< Point3d, ChangesItem> >& changes,
81 bool add,
bool wholeImage ) ;
82 bool fillPoint(
const Point3d& pc,
int t,
86 std::queue<Point3d>& trialPoints,
bool replace =
false,
bool add =
true ) ;
91 static std::vector< std::map< int16_t, int32_t> > myCurrentImageValues ;
92 static std::vector<bool> myComputeCurrentImageValueMap ;
93 static int32_t myNbOfPointsToSegmentLimit ;
96 struct PointLess :
public std::binary_function< Point3d, Point3d , bool>
100 return( p1[2] < p2[2]
101 || ( (p1[2] == p2[2]) && (p1[1] < p2[1]) )
102 || ( (p1[2] == p2[2])
103 && (p1[1] == p2[1]) && (p1[0] < p2[0]) ) ) ;
111 anatomist::RoiLabelNamingAction::fillPoint(
const Point3d& pc,
int t,
115 std::queue<Point3d>& trialPoints,
bool replace,
bool add )
120 std::vector<float> vpos( 4 );
125 float val = myCurrentImage->mixedTexValue( vpos );
128 if( (volumeOfLabels( pc ) != region)
129 && (
short(rint(val) == label)
130 && ( replace || ( (!replace) && volumeOfLabels( pc ) == 0 )) ) )
133 trialPoints.push(pc) ;
134 *toChange = volumeOfLabels( pc ) ;
136 volumeOfLabels( pc ) = region ;
142 if( (volumeOfLabels( pc ) != 0 ) && (
short(rint(val) == label)
143 && ( replace || ( (!replace) && volumeOfLabels( pc ) == region ) ) ) )
146 trialPoints.push(pc) ;
147 *toChange = volumeOfLabels( pc ) ;
149 volumeOfLabels( pc ) = 0 ;
159 anatomist::RoiLabelNamingAction::in(
const Point3d& dims,
const Point3d& p )
161 if ( p[0] < 0 || p[0] > dims[0] - 1 ||
162 p[1] < 0 || p[1] > dims[1] - 1 ||
163 p[2] < 0 || p[2] > dims[2] - 1 )
Anatomist graph object: a list that manages destruction of its sub-elements.
void removeConnecCompFromRegion(int x, int y, int globalX, int globalY)
Base Anatomist object (abstract)
virtual ~RoiLabelNamingAction()
void addConnecCompToRegion(int x, int y, int globalX, int globalY)
void removeWholeLabelFromRegion(int x, int y, int globalX, int globalY)
void addWholeLabelToRegion(int x, int y, int globalX, int globalY)
virtual std::string name() const
static Action * creator()