Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Seg3D::PointSetFilterAlgo Class Reference
Inheritance diagram for Seg3D::PointSetFilterAlgo:
Seg3D::ITKFilter Seg3D::LayerFilter Seg3D::LayerAbstractFilter Core::Runnable

Public Types

typedef itk::PointSet< float, DIMENSION_C > point_set_type
 
typedef point_set_type::PointType point_type
 
typedef point_set_type::PointsContainer points_container_type
 
typedef itk::EuclideanDistancePointMetric< point_set_type, point_set_type > metric_type
 
typedef metric_type::TransformType transform_base_type
 
typedef transform_base_type::ParametersType parameters_type
 
typedef transform_base_type::JacobianType jacobian_type
 
typedef itk::Euler3DTransform< double > transform_type
 
typedef itk::LevenbergMarquardtOptimizer optimizer_type
 
typedef itk::PointSetToPointSetRegistrationMethod< point_set_type, point_set_type > registration_type
 
typedef itk::LinearInterpolateImageFunction< TYPED_IMAGE_TYPE, double > interpolator_type
 
typedef itk::ResampleImageFilter< TYPED_IMAGE_TYPE, TYPED_IMAGE_TYPE > resample_filter_type
 
- Public Types inherited from Seg3D::ITKFilter
typedef itk::Image< unsigned short, 3 > USHORT_IMAGE_TYPE
 
typedef itk::Image< unsigned int, 3 > UINT_IMAGE_TYPE
 
typedef itk::Image< float, 3 > FLOAT_IMAGE_TYPE
 
typedef itk::Image< unsigned char, 3 > UCHAR_IMAGE_TYPE
 
typedef Core::ITKImageDataT< float > FLOAT_CONTAINER_TYPE
 
typedef Core::ITKImageDataT< unsigned int > UINT_CONTAINER_TYPE
 
typedef Core::ITKImageDataT< unsigned short > USHORT_CONTAINER_TYPE
 
typedef Core::ITKImageDataT< unsigned char > UCHAR_CONTAINER_TYPE
 

Public Member Functions

bool check_abort ()
 
 while (!sample_ready)
 
 for (cii=fixed_iso_points_set.begin();cii!=fixed_iso_points_set.end();cii++)
 
fixed_point_set SetPoints (fixed_point_container)
 
 CORE_LOG_MESSAGE (std::string("Number of fixed Points = ")+boost::lexical_cast< std::string >(fixed_points_num))
 
 for (cii=moving_iso_points_set.begin();cii!=moving_iso_points_set.end();cii++)
 
moving_point_set SetPoints (moving_point_container)
 
 CORE_LOG_MESSAGE (std::string("Number of moving Points = ")+boost::lexical_cast< std::string >(moving_points_num))
 
optimizer SetUseCostFunctionGradient (false)
 
this forward_abort_to_filter (registration, this->dst_layer_)
 
optimizer_type::ScalesType scales (transform->GetNumberOfParameters())
 
optimizer SetScales (scales)
 
optimizer SetNumberOfIterations (number_of_iterations)
 
optimizer SetValueTolerance (value_tolerance)
 
optimizer SetGradientTolerance (gradient_tolerance)
 
optimizer SetEpsilonFunction (epsilon_function)
 
transform SetIdentity ()
 
registration SetInitialTransformParameters (transform->GetParameters())
 
registration SetMetric (metric)
 
registration SetOptimizer (optimizer)
 
registration SetTransform (transform)
 
registration SetFixedPointSet (fixed_point_set)
 
registration SetMovingPointSet (moving_point_set)
 
this forward_abort_to_filter (registration, this->dst_layer_)
 
this observe_itk_iterations (optimizer, boost::bind( &PointSetFilterAlgo::update_iteration, this, _1, progress_unit))
 
this limit_number_of_itk_threads (registration)
 
 catch (...)
 
 if (this->check_abort()) return
 
 CORE_LOG_MESSAGE (std::string("Solution = ")+solution)
 
 for (unsigned int i=0;i< final_parameters.size();++i)
 
final_transform SetParameters (final_parameters)
 
this get_itk_image_from_layer (this->mask_layer_, moving_image)
 
resampler SetInput (moving_image->get_image())
 
final_transform GetInverse (final_transform)
 
resampler SetTransform (final_transform)
 
this get_itk_image_from_layer (this->src_layer_, fixed_image)
 
resampler SetSize (fixed_image->get_image() ->GetLargestPossibleRegion().GetSize())
 
resampler SetOutputOrigin (fixed_image->get_image() ->GetOrigin())
 
resampler SetOutputSpacing (fixed_image->get_image() ->GetSpacing())
 
resampler SetOutputDirection (fixed_image->get_image() ->GetDirection())
 
resampler SetDefaultPixelValue (0)
 
resampler Update ()
 
 if (resampler->GetOutput()!=NULL)
 
virtual std::string get_filter_name () const
 
virtual std::string get_layer_prefix () const
 
- Public Member Functions inherited from Seg3D::LayerFilter
virtual void raise_abort () override
 
void raise_stop ()
 
bool check_stop ()
 
virtual void abort_and_wait () override
 
void connect_abort (const LayerHandle &layer)
 
void connect_stop (const LayerHandle &layer)
 
Core::NotifierHandle get_notifier ()
 
bool find_layer (const std::string &layer_id, LayerHandle &layer)
 
bool lock_for_use (LayerHandle layer)
 
bool lock_for_processing (LayerHandle layer)
 
bool lock_for_deletion (LayerHandle layer)
 
bool create_and_lock_data_layer_from_layer (LayerHandle src_layer, LayerHandle &dst_layer)
 
bool create_and_lock_data_layer (const Core::GridTransform &grid_trans, LayerHandle src_layer, LayerHandle &dst_layer)
 
bool create_cropped_large_volume_layer (const Core::GridTransform &crop_trans, LayerHandle src_layer, LayerHandle &dst_layer)
 
bool create_and_lock_mask_layer_from_layer (LayerHandle src_layer, LayerHandle &dst_layer)
 
bool create_and_lock_mask_layer_from_layer (LayerHandle src_layer, LayerHandle &dst_layer, std::string dst_name)
 
bool create_and_lock_mask_layer (const Core::GridTransform &grid_trans, LayerHandle src_layer, LayerHandle &dst_layer)
 
bool dispatch_unlock_layer (LayerHandle layer)
 
bool dispatch_delete_layer (LayerHandle layer)
 
bool dispatch_insert_data_volume_into_layer (LayerHandle layer, Core::DataVolumeHandle data, bool update_histogram)
 
bool dispatch_insert_mask_volume_into_layer (LayerHandle layer, Core::MaskVolumeHandle mask)
 
void create_undo_redo_and_provenance_record (Core::ActionContextHandle context, Core::ActionHandle action, bool split_prov=false)
 
bool update_provenance_action_string (Core::ActionHandle action)
 
void set_sandbox (SandboxID sandbox)
 
SandboxID get_sandbox ()
 
void report_error (const std::string &error)
 
Layer::filter_key_type get_key () const
 

Public Attributes

LayerHandle src_layer_
 
LayerHandle mask_layer_
 
LayerHandle dst_layer_
 
int iterations_
 
std::string transform_state_id_
 
MaskLayerHandle input_moving_layer
 
double quality_factor = 1.0
 
Core::IsosurfaceHandle fixed_iso
 
Core::IsosurfaceHandle moving_iso
 
std::vector< Core::PointFfixed_iso_points_set
 
std::vector< Core::PointFmoving_iso_points_set
 
bool sample_ready = false
 
const unsigned int DIMENSION_C = 3
 
point_set_type::Pointer fixed_point_set = point_set_type::New()
 
point_set_type::Pointer moving_point_set = point_set_type::New()
 
points_container_type::Pointer fixed_point_container = points_container_type::New()
 
points_container_type::Pointer moving_point_container = points_container_type::New()
 
unsigned int point_id = 0
 
std::vector< Core::PointF >::const_iterator cii
 
unsigned long fixed_points_num = fixed_point_set->GetNumberOfPoints()
 
 point_id = 0
 
unsigned long moving_points_num = moving_point_set->GetNumberOfPoints()
 
metric_type::Pointer metric = metric_type::New()
 
transform_type::Pointer transform = transform_type::New()
 
optimizer_type::Pointer optimizer = optimizer_type::New()
 
registration_type::Pointer registration = registration_type::New()
 
const double TRANSLATION_SCALE_C = 1000.0
 
const double ROTATION_SCALE_C = 1.0
 
 scales [0] = 1.0 / ROTATION_SCALE_C
 
unsigned long number_of_iterations = this->iterations_
 
double gradient_tolerance = 1e-5
 
double value_tolerance = 1e-5
 
double epsilon_function = 1e-6
 
double progress_unit = 1.0 / number_of_iterations
 
this progress_ = 0.0
 
 try
 
registration_type::ParametersType final_parameters
 
std::string solution
 
std::vector< double > matrix_entries
 
transform_type::Pointer final_transform = transform_type::New()
 
resample_filter_type::Pointer resampler = resample_filter_type::New()
 
Core::ITKImageDataT< VALUE_TYPE >::Handle moving_image
 
Core::ITKImageDataT< VALUE_TYPE >::Handle fixed_image
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::Runnable
static void Start (RunnableHandle runnable)
 
- Protected Member Functions inherited from Seg3D::ITKFilter
template<class T >
bool get_itk_image_from_layer (const LayerHandle &layer, typename Core::ITKImageDataT< T >::Handle &image, bool invert=false)
 
template<class T >
bool get_itk_image_from_mask_layer (const LayerHandle &layer, typename Core::ITKImageDataT< T >::Handle &image, double label=1.0)
 
template<class T >
bool insert_itk_image_into_layer (const LayerHandle &layer, typename itk::Image< T, 3 > *itk_image)
 
template<class T >
bool insert_itk_image_pointer_into_layer (const LayerHandle &layer, typename itk::Image< T, 3 >::Pointer itk_image)
 
template<class T >
bool insert_itk_positive_labels_into_mask_layer (const LayerHandle &layer, typename itk::Image< T, 3 > *itk_image, bool invert=false)
 
template<class T >
bool insert_itk_positive_labels_pointer_into_mask_layer (const LayerHandle &layer, typename itk::Image< T, 3 >::Pointer itk_image, bool invert=false)
 
template<class T >
bool insert_itk_label_into_mask_layer (const LayerHandle &layer, typename itk::Image< T, 3 > *itk_image, T label)
 
template<class T >
bool insert_itk_label_pointer_into_mask_layer (const LayerHandle &layer, typename itk::Image< T, 3 >::Pointer itk_image, T label)
 
template<class T >
bool convert_and_insert_itk_image_into_layer (const LayerHandle &layer, typename itk::Image< T, 3 > *itk_image, Core::DataType data_type)
 
template<class T >
bool convert_and_insert_itk_image_pointer_into_layer (const LayerHandle &layer, typename itk::Image< T, 3 >::Pointer itk_image, Core::DataType data_type)
 
template<class T >
void forward_abort_to_filter (T filter_pointer, LayerHandle layer)
 
template<class T >
void observe_itk_progress (T filter_pointer, const LayerHandle &layer, float progress_start=0.0, float progress_amount=1.0)
 
template<class T >
void observe_itk_iterations (T filter_pointer, boost::function< void(itk::Object *) > iteration_fcn)
 
template<class T >
void limit_number_of_itk_threads (T filter_pointer)
 
virtual void handle_abort ()
 
virtual void handle_stop ()
 
- Protected Member Functions inherited from Seg3D::LayerFilter
virtual void run_filter ()=0
 
virtual void run ()
 

Member Function Documentation

bool Seg3D::PointSetFilterAlgo::check_abort ( )
inlinevirtual

CHECK_ABORT: Check the abort flag

Reimplemented from Seg3D::LayerFilter.

virtual std::string Seg3D::PointSetFilterAlgo::get_filter_name ( ) const
inlinevirtual

GET_FILTER_NAME: This functions returns the name of the filter that is used in the error report.

Implements Seg3D::LayerFilter.

virtual std::string Seg3D::PointSetFilterAlgo::get_layer_prefix ( ) const
inlinevirtual

GET_LAYER_PREFIX: This function returns the name of the filter. The latter is prepended to the new layer name, when a new layer is generated.

Implements Seg3D::LayerFilter.

Member Data Documentation

registration_type::ParametersType Seg3D::PointSetFilterAlgo::final_parameters
Initial value:
=
registration->GetLastTransformParameters()
MaskLayerHandle Seg3D::PointSetFilterAlgo::input_moving_layer
Initial value:
=
boost::dynamic_pointer_cast<MaskLayer>( this->mask_layer_ )
std::string Seg3D::PointSetFilterAlgo::solution
Initial value:
= "[" + boost::lexical_cast<std::string>(final_parameters[0]) +
"," + boost::lexical_cast<std::string>(final_parameters[1]) +"," +
boost::lexical_cast<std::string>(final_parameters[2]) + "," +
boost::lexical_cast<std::string>(final_parameters[3]) + "," +
boost::lexical_cast<std::string>(final_parameters[4]) + "," +
boost::lexical_cast<std::string>(final_parameters[5]) + "]"
Seg3D::PointSetFilterAlgo::try
Initial value:
{
registration->Update()

The documentation for this class was generated from the following file: