00001 #ifndef rgrl_feature_trace_region_h_ 00002 #define rgrl_feature_trace_region_h_ 00003 //: 00004 // \file 00005 // \author Amitha Perera 00006 // \date Feb 2003 00007 00008 #include <rgrl/rgrl_feature_trace_pt.h> 00009 #include <rgrl/rgrl_feature_region.h> 00010 #include <vcl_vector.h> 00011 00012 //: Represent a point along a trace (of a vessel, neuron, etc.) 00013 // 00014 // A trace point is characterized by a location and a tangent along 00015 // the trace. 00016 // 00017 class rgrl_feature_trace_region 00018 : public rgrl_feature_trace_pt, public rgrl_feature_region 00019 { 00020 public: 00021 typedef vcl_vector<rgrl_feature_sptr > feature_vector; 00022 00023 public: 00024 //: Constructor to initialize feature_trace_region location. 00025 rgrl_feature_trace_region( vnl_vector<double> const& loc, 00026 vnl_vector<double> const& tangent ); 00027 00028 //: Constructor to initialize feature_trace_region location that has a length along the tangent and a normal. 00029 rgrl_feature_trace_region( vnl_vector<double> const& loc, 00030 vnl_vector<double> const& tangent, 00031 double region_length, 00032 double region_radius ); 00033 00034 //: The result is a rgrl_feature_trace_region, without transforming the radius/length parameters 00035 rgrl_feature_sptr 00036 transform( rgrl_transformation const& xform ) const; 00037 00038 //: The result is a rgrl_feature_trace_region, with a transformation of the radius/length parameters 00039 rgrl_feature_sptr 00040 transform_region( rgrl_transformation const& xform ) const; 00041 00042 //: Result is a vector of boundary locations in the direction of the normal in the plane defined by the tangent and in_direction. 00043 // // CAVEAT: This design is not good enough for 3D trace points, since it only 00044 // // produces 2 boundary constraints. This function should be revised 00045 // // later for 3D. 00046 // // 00047 // // Chuck's comment: I'm not sure this should be here. It can 00048 // // easily be extracted in an arbitrary set of dimensions from a 00049 // // normal subspace and the radius. 00050 // feature_vector 00051 // boundary_points(vnl_vector<double> const& in_direction) const; 00052 00053 unsigned int num_constraints() const; 00054 00055 // Defines type-related functions 00056 rgrl_type_macro( rgrl_feature_trace_region, rgrl_feature_trace_pt ); 00057 00058 double region_length() const { return region_length_; } 00059 double region_radius() const { return region_radius_; } 00060 00061 //: Extract the pixel coordinates within the oriented rectangular solid defined by the feature. 00062 virtual void generate_pixel_coordinates( vnl_vector< double > const& spacing_ratio ); 00063 00064 // Chuck's note: I am beginning to wonder if we are trying to do 00065 // too much here. Perhaps we should be make a subclass for the 00066 // region-based estimator. 00067 00068 private: 00069 //: 00070 // Create an uninitialized feature with enough space to store a dim 00071 // dimensional feature. The error projection matrix is initialized 00072 // to the identity. 00073 // 00074 rgrl_feature_trace_region(); 00075 00076 // Chuck's note: We'll have to be careful with the meaning of 00077 // these. For example, in aligning extracted vessel boundaries, 00078 // the radius_ might mean the half-width of the vessel, whereas in 00079 // the pseudo-feature-based registration application, you might 00080 // want the radius to be slightly larger... 00081 00082 // For pseudo matcher method, length_ is the length along the 00083 // tangent direction, centered at the feature point's location. 00084 double region_length_; 00085 // For pseudo matcher method, radius_ is half of the length along 00086 // the normal directions. 00087 double region_radius_; 00088 }; 00089 00090 #endif