OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
fieldimageprocessing.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #ifndef CMZN_FIELDIMAGEPROCESSING_HPP__
10 #define CMZN_FIELDIMAGEPROCESSING_HPP__
11 
12 #include "zinc/field.hpp"
13 #include "zinc/fieldimageprocessing.h"
14 #include "zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldImagefilterBinaryDilate : public Field
31 {
32 
33 private:
34  explicit FieldImagefilterBinaryDilate(cmzn_field_id field_id) : Field(field_id)
35  { }
36 
37  friend FieldImagefilterBinaryDilate
38  Fieldmodule::createFieldImagefilterBinaryDilate(const Field& sourceField,
39  int radius, double dilate_value);
40 
41 public:
42 
43  FieldImagefilterBinaryDilate() : Field(0)
44  { }
45 
46 };
47 class FieldImagefilterBinaryErode : public Field
58 {
59 
60 private:
61  explicit FieldImagefilterBinaryErode(cmzn_field_id field_id) : Field(field_id)
62  { }
63 
64  friend FieldImagefilterBinaryErode
65  Fieldmodule::createFieldImagefilterBinaryErode(const Field& sourceField,
66  int radius, double erode_value);
67 
68 public:
69 
70  FieldImagefilterBinaryErode() : Field(0)
71  { }
72 
73 };
74 
81 {
82 public:
83 
85  { }
86 
87  // takes ownership of C handle, responsibility for destroying it
88  explicit FieldImagefilterBinaryThreshold(cmzn_field_imagefilter_binary_threshold_id field_imagefilter_binary_threshold_id) :
89  Field(reinterpret_cast<cmzn_field_id>(field_imagefilter_binary_threshold_id))
90  { }
91 
98  {
99  return cmzn_field_imagefilter_binary_threshold_get_lower_threshold(
100  reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(id));
101  }
102 
109  int setLowerThreshold(double lowerThreshold)
110  {
111  return cmzn_field_imagefilter_binary_threshold_set_lower_threshold(
112  reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(id),
113  lowerThreshold);
114  }
115 
122  {
123  return cmzn_field_imagefilter_binary_threshold_get_upper_threshold(
124  reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(id));
125  }
126 
133  int setUpperThreshold(double upperThreshold)
134  {
135  return cmzn_field_imagefilter_binary_threshold_set_upper_threshold(
136  reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(id),
137  upperThreshold);
138  }
139 
140 };
141 class FieldImagefilterCannyEdgeDetection : public Field
150 {
151 
152 private:
153  explicit FieldImagefilterCannyEdgeDetection(cmzn_field_id field_id) : Field(field_id)
154  { }
155 
156  friend FieldImagefilterCannyEdgeDetection
158  double variance, double maximumError, double upperThreshold, double lowerThreshold);
159 
160 public:
161 
162  FieldImagefilterCannyEdgeDetection() : Field(0)
163  { }
164 
165 };
166 class FieldImagefilterConnectedThreshold : public Field
175 {
176 
177 private:
178  // takes ownership of C handle, responsibility for destroying it
179  explicit FieldImagefilterConnectedThreshold(cmzn_field_id field_id) : Field(field_id)
180  { }
181 
182  friend FieldImagefilterConnectedThreshold
184  double lowerThreshold, double upperThreshold, double replaceValue,
185  int dimension, int seedPointsCount, const double *seedPoints);
186 
187 public:
188 
189  FieldImagefilterConnectedThreshold() : Field(0)
190  { }
191 
192 };
193 class FieldImagefilterCurvatureAnisotropicDiffusion : public Field
203 {
204 
205 private:
206  // takes ownership of C handle, responsibility for destroying it
207  explicit FieldImagefilterCurvatureAnisotropicDiffusion(cmzn_field_id field_id) : Field(field_id)
208  { }
209 
210  friend FieldImagefilterCurvatureAnisotropicDiffusion
212  double timeStep, double conductance, int numIterations);
213 
214 public:
215 
216  FieldImagefilterCurvatureAnisotropicDiffusion() : Field(0)
217  { }
218 
219 };
220 
227 {
228 public:
229 
231  { }
232 
233  // takes ownership of C handle, responsibility for destroying it
234  explicit FieldImagefilterDiscreteGaussian(cmzn_field_imagefilter_discrete_gaussian_id field_imagefilter_discrete_gaussian_id) :
235  Field(reinterpret_cast<cmzn_field_id>(field_imagefilter_discrete_gaussian_id))
236  { }
237 
244  double getVariance()
245  {
246  return cmzn_field_imagefilter_discrete_gaussian_get_variance(
247  reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(id));
248  }
249 
260  int setVariance(double variance)
261  {
262  return cmzn_field_imagefilter_discrete_gaussian_set_variance(
263  reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(id),
264  variance);
265  }
266 
274  {
275  return cmzn_field_imagefilter_discrete_gaussian_get_max_kernel_width(
276  reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(id));
277  }
278 
288  int setMaxKernelWidth(int maxKernelWidth)
289  {
290  return cmzn_field_imagefilter_discrete_gaussian_set_max_kernel_width(
291  reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(id),
292  maxKernelWidth);
293  }
294 
295 };
296 
303 {
304 public:
305 
307  { }
308 
309  // takes ownership of C handle, responsibility for destroying it
310  explicit FieldImagefilterHistogram(cmzn_field_imagefilter_histogram_id field_imagefilter_histogram_id) :
311  Field(reinterpret_cast<cmzn_field_id>(field_imagefilter_histogram_id))
312  { }
313 
324  int getComputeMinimumValues(int valuesCount, double *valuesOut)
325  {
326  return cmzn_field_imagefilter_histogram_get_compute_minimum_values(
327  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
328  valuesCount, valuesOut);
329  }
330 
343  int setComputeMinimumValues(int valuesCount, const double *valuesIn)
344  {
345  return cmzn_field_imagefilter_histogram_set_compute_minimum_values(
346  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
347  valuesCount, valuesIn);
348  }
349 
360  int getComputeMaximumValues(int valuesCount, double *valuesOut)
361  {
362  return cmzn_field_imagefilter_histogram_get_compute_maximum_values(
363  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
364  valuesCount, valuesOut);
365  }
366 
379  int setComputeMaximumValues(int valuesCount, const double *valuesIn)
380  {
381  return cmzn_field_imagefilter_histogram_set_compute_maximum_values(
382  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
383  valuesCount, valuesIn);
384  }
385 
397  int getNumberOfBins(int valuesCount, int *valuesOut)
398  {
399  return cmzn_field_imagefilter_histogram_get_number_of_bins(
400  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
401  valuesCount, valuesOut);
402  }
403 
419  int setNumberOfBins(int valuesCount, const int *valuesIn)
420  {
421  return cmzn_field_imagefilter_histogram_set_number_of_bins(
422  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
423  valuesCount, valuesIn);
424  }
425 
435  {
436  return cmzn_field_imagefilter_histogram_get_marginal_scale(
437  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id));
438  }
439 
449  int setMarginalScale(double marginalScale)
450  {
451  return cmzn_field_imagefilter_histogram_set_marginal_scale(
452  reinterpret_cast<cmzn_field_imagefilter_histogram_id>(id),
453  marginalScale);
454  }
455 
456 };
457 class FieldImagefilterGradientMagnitudeRecursiveGaussian : public Field
467 {
468 
469 private:
470  // takes ownership of C handle, responsibility for destroying it
471  explicit FieldImagefilterGradientMagnitudeRecursiveGaussian(cmzn_field_id field_id) : Field(field_id)
472  { }
473 
474  friend FieldImagefilterGradientMagnitudeRecursiveGaussian
476  double sigma);
477 
478 public:
479 
480  FieldImagefilterGradientMagnitudeRecursiveGaussian() : Field(0)
481  { }
482 
483 };
484 class FieldImagefilterRescaleIntensity : public Field
493 {
494 
495 private:
496  // takes ownership of C handle, responsibility for destroying it
497  explicit FieldImagefilterRescaleIntensity(cmzn_field_id field_id) : Field(field_id)
498  { }
499 
500  friend FieldImagefilterRescaleIntensity
502  double outputMin, double outputMax);
503 
504 public:
505 
506  FieldImagefilterRescaleIntensity() : Field(0)
507  { }
508 
509 };
510 
511 class FieldImagefilterMean : public Field
521 {
522 
523 private:
524  // takes ownership of C handle, responsibility for destroying it
525  explicit FieldImagefilterMean(cmzn_field_id field_id) : Field(field_id)
526  { }
527 
528  friend FieldImagefilterMean
529  Fieldmodule::createFieldImagefilterMean(const Field& sourceField,
530  int valuesCount,const int *radiusSizesIn);
531 
532 public:
533 
534  FieldImagefilterMean() : Field(0)
535  { }
536 
537 };
538 class FieldImagefilterSigmoid : public Field
547 {
548 
549 private:
550  // takes ownership of C handle, responsibility for destroying it
551  explicit FieldImagefilterSigmoid(cmzn_field_id field_id) : Field(field_id)
552  { }
553 
554  friend FieldImagefilterSigmoid
555  Fieldmodule::createFieldImagefilterSigmoid(const Field& sourceField,
556  double min, double max, double alpha, double beta);
557 
558 public:
559 
560  FieldImagefilterSigmoid() : Field(0)
561  { }
562 
563 };
564 
565 
572 {
573 public:
574 
576  { }
577 
578  // takes ownership of C handle, responsibility for destroying it
579  explicit FieldImagefilterThreshold(cmzn_field_imagefilter_threshold_id field_imagefilter_threshold_id) :
580  Field(reinterpret_cast<cmzn_field_id>(field_imagefilter_threshold_id))
581  { }
582 
588  {
589  CONDITION_INVALID = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_INVALID,
591  CONDITION_ABOVE = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_ABOVE,
593  CONDITION_BELOW = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_BELOW,
596  CONDITION_OUTSIDE = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_OUTSIDE
598  };
599 
606  {
607  return static_cast<Condition>(cmzn_field_imagefilter_threshold_get_condition(
608  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id)));
609  }
610 
620  int setCondition(Condition condition)
621  {
622  return cmzn_field_imagefilter_threshold_set_condition(
623  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id),
624  static_cast<cmzn_field_imagefilter_threshold_condition>(condition));
625  }
626 
633  {
634  return cmzn_field_imagefilter_threshold_get_outside_value(
635  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
636  }
637 
644  int setOutsideValue(double outsideValue)
645  {
646  return cmzn_field_imagefilter_threshold_set_outside_value(
647  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), outsideValue);
648  }
649 
656  {
657  return cmzn_field_imagefilter_threshold_get_lower_threshold(
658  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
659  }
660 
669  int setLowerThreshold(double lowerValue)
670  {
671  return cmzn_field_imagefilter_threshold_set_lower_threshold(
672  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), lowerValue);
673  }
674 
681  {
682  return cmzn_field_imagefilter_threshold_get_upper_threshold(
683  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
684  }
685 
694  int setUpperThreshold(double upperValue)
695  {
696  return cmzn_field_imagefilter_threshold_set_upper_threshold(
697  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), upperValue);
698  }
699 
700 };
701 
702 inline FieldImagefilterBinaryDilate
704  int radius, double dilate_value)
705 {
707  cmzn_fieldmodule_create_field_imagefilter_binary_dilate(id, sourceField.getId(),
708  radius, dilate_value));
709 }
710 
713  int radius, double erode_value)
714 {
716  cmzn_fieldmodule_create_field_imagefilter_binary_erode(id, sourceField.getId(),
717  radius, erode_value));
718 }
719 
722 {
723  return FieldImagefilterBinaryThreshold(reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(
724  cmzn_fieldmodule_create_field_imagefilter_binary_threshold(id, sourceField.getId())));
725 }
726 
728 {
729  return FieldImagefilterBinaryThreshold(cmzn_field_cast_imagefilter_binary_threshold(id));
730 }
731 
734  double variance, double maximumError, double upperThreshold, double lowerThreshold)
735 {
737  cmzn_fieldmodule_create_field_imagefilter_canny_edge_detection(
738  id, sourceField.getId(),
739  variance, maximumError, upperThreshold, lowerThreshold));
740 }
741 
744  double lowerThreshold, double upperThreshold, double replaceValue,
745  int dimension, int seedPointsCount, const double *seedPoints)
746 {
748  cmzn_fieldmodule_create_field_imagefilter_connected_threshold(id, sourceField.getId(),
749  lowerThreshold, upperThreshold, replaceValue, seedPointsCount, dimension, seedPoints));
750 }
751 
754  double timeStep, double conductance, int numIterations)
755 {
757  cmzn_fieldmodule_create_field_imagefilter_curvature_anisotropic_diffusion(id, sourceField.getId(),
758  timeStep, conductance, numIterations));
759 }
760 
763 {
764  return FieldImagefilterDiscreteGaussian(reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(
765  cmzn_fieldmodule_create_field_imagefilter_discrete_gaussian(id, sourceField.getId())));
766 }
767 
769 {
770  return FieldImagefilterDiscreteGaussian(cmzn_field_cast_imagefilter_discrete_gaussian(id));
771 }
772 
775  double sigma)
776 {
778  cmzn_fieldmodule_create_field_imagefilter_gradient_magnitude_recursive_gaussian(id,
779  sourceField.getId(), sigma));
780 }
781 
784 {
785  return FieldImagefilterHistogram(reinterpret_cast<cmzn_field_imagefilter_histogram_id>(
786  cmzn_fieldmodule_create_field_imagefilter_histogram(id, sourceField.getId())));
787 }
788 
790 {
791  return FieldImagefilterHistogram(cmzn_field_cast_imagefilter_histogram(id));
792 }
793 
796  double outputMin, double outputMax)
797 {
799  cmzn_fieldmodule_create_field_imagefilter_rescale_intensity(id,
800  sourceField.getId(), outputMin, outputMax));
801 }
802 
804  int valuesCount, const int *radiusSizesIn)
805 {
806  return FieldImagefilterMean(cmzn_fieldmodule_create_field_imagefilter_mean(
807  id, sourceField.getId(), valuesCount, radiusSizesIn));
808 }
809 
812  double min, double max, double alpha, double beta)
813 {
815  cmzn_fieldmodule_create_field_imagefilter_sigmoid(id,
816  sourceField.getId(), min, max, alpha, beta));
817 }
818 
821 {
822  return FieldImagefilterThreshold(reinterpret_cast<cmzn_field_imagefilter_threshold_id>(
823  cmzn_fieldmodule_create_field_imagefilter_threshold(
824  id, sourceField.getId())));
825 }
826 
828 {
829  return FieldImagefilterThreshold(cmzn_field_cast_imagefilter_threshold(id));
830 }
831 
832 } // namespace Zinc
833 }
834 
835 #endif
A field performing ITK binary dilate image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:30
int getMaxKernelWidth()
Definition: fieldimageprocessing.hpp:273
FieldImagefilterCannyEdgeDetection createFieldImagefilterCannyEdgeDetection(const Field &sourceField, double variance, double maximumError, double upperThreshold, double lowerThreshold)
Definition: fieldimageprocessing.hpp:733
FieldImagefilterDiscreteGaussian castImagefilterDiscreteGaussian()
Definition: fieldimageprocessing.hpp:768
int setOutsideValue(double outsideValue)
Definition: fieldimageprocessing.hpp:644
FieldImagefilterDiscreteGaussian createFieldImagefilterDiscreteGaussian(const Field &sourceField)
Definition: fieldimageprocessing.hpp:762
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
Definition: fieldimageprocessing.hpp:591
FieldImagefilterBinaryDilate createFieldImagefilterBinaryDilate(const Field &sourceField, int radius, double dilate_value)
Definition: fieldimageprocessing.hpp:703
int setComputeMaximumValues(int valuesCount, const double *valuesIn)
Definition: fieldimageprocessing.hpp:379
double getVariance()
Definition: fieldimageprocessing.hpp:244
int setLowerThreshold(double lowerThreshold)
Definition: fieldimageprocessing.hpp:109
FieldImagefilterCurvatureAnisotropicDiffusion createFieldImagefilterCurvatureAnisotropicDiffusion(const Field &sourceField, double timeStep, double conductance, int numIterations)
Definition: fieldimageprocessing.hpp:753
int setVariance(double variance)
Definition: fieldimageprocessing.hpp:260
int setCondition(Condition condition)
Definition: fieldimageprocessing.hpp:620
int getNumberOfBins(int valuesCount, int *valuesOut)
Definition: fieldimageprocessing.hpp:397
FieldImagefilterBinaryErode createFieldImagefilterBinaryErode(const Field &sourceField, int radius, double erode_value)
Definition: fieldimageprocessing.hpp:712
FieldImagefilterHistogram createFieldImagefilterHistogram(const Field &sourceField)
Definition: fieldimageprocessing.hpp:783
FieldImagefilterRescaleIntensity createFieldImagefilterRescaleIntensity(const Field &sourceField, double outputMin, double outputMax)
Definition: fieldimageprocessing.hpp:795
double getLowerThreshold()
Definition: fieldimageprocessing.hpp:97
Definition: fieldimageprocessing.hpp:593
double getUpperThreshold()
Definition: fieldimageprocessing.hpp:680
Image processing derived field type performing the ITK discrete gaussian filter.
Definition: fieldimageprocessing.hpp:226
A field returning result of ITK canny edge detection filter on the source field image.
Definition: fieldimageprocessing.hpp:149
int setNumberOfBins(int valuesCount, const int *valuesIn)
Definition: fieldimageprocessing.hpp:419
A field performing ITK connected threshold image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:174
cmzn_field_id getId() const
Definition: field.hpp:98
FieldImagefilterMean createFieldImagefilterMean(const Field &sourceField, int valuesCount, const int *radiusSizesIn)
Definition: fieldimageprocessing.hpp:803
Condition
Definition: fieldimageprocessing.hpp:587
double getOutsideValue()
Definition: fieldimageprocessing.hpp:632
int setUpperThreshold(double upperValue)
Definition: fieldimageprocessing.hpp:694
enum Condition getCondition()
Definition: fieldimageprocessing.hpp:605
FieldImagefilterConnectedThreshold createFieldImagefilterConnectedThreshold(const Field &sourceField, double lowerThreshold, double upperThreshold, double replaceValue, int dimension, int seedPointsCount, const double *seedPoints)
Definition: fieldimageprocessing.hpp:743
A field performing ITK mean image filter on source_field image.
Definition: fieldimageprocessing.hpp:520
int setUpperThreshold(double upperThreshold)
Definition: fieldimageprocessing.hpp:133
FieldImagefilterHistogram castImagefilterHistogram()
Definition: fieldimageprocessing.hpp:789
Image processing derived field type performing the ITK threshold filter.
Definition: fieldimageprocessing.hpp:571
double getMarginalScale()
Definition: fieldimageprocessing.hpp:434
A field performing ITK curvature anisotropic diffusion image filter on scalar source field image...
Definition: fieldimageprocessing.hpp:202
int setLowerThreshold(double lowerValue)
Definition: fieldimageprocessing.hpp:669
FieldImagefilterThreshold createFieldImagefilterThreshold(const Field &sourceField)
Definition: fieldimageprocessing.hpp:820
A field performing ITK binary erode image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:57
double getLowerThreshold()
Definition: fieldimageprocessing.hpp:655
Image processing derived field type performing the ITK histogram field.
Definition: fieldimageprocessing.hpp:302
A field performing ITK gradient magnitude recursive gaussian image filter on scalar source field imag...
Definition: fieldimageprocessing.hpp:466
int setComputeMinimumValues(int valuesCount, const double *valuesIn)
Definition: fieldimageprocessing.hpp:343
double getUpperThreshold()
Definition: fieldimageprocessing.hpp:121
Image processing derived field type performing the ITK binary threshold filter.
Definition: fieldimageprocessing.hpp:80
A field performing ITK sigmoid image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:546
FieldImagefilterBinaryThreshold createFieldImagefilterBinaryThreshold(const Field &sourceField)
Definition: fieldimageprocessing.hpp:721
A field performing ITK rescale intensity image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:492
int getComputeMaximumValues(int valuesCount, double *valuesOut)
Definition: fieldimageprocessing.hpp:360
int setMarginalScale(double marginalScale)
Definition: fieldimageprocessing.hpp:449
FieldImagefilterGradientMagnitudeRecursiveGaussian createFieldImagefilterGradientMagnitudeRecursiveGaussian(const Field &sourceField, double sigma)
Definition: fieldimageprocessing.hpp:774
FieldImagefilterBinaryThreshold castImagefilterBinaryThreshold()
Definition: fieldimageprocessing.hpp:727
int setMaxKernelWidth(int maxKernelWidth)
Definition: fieldimageprocessing.hpp:288
FieldImagefilterSigmoid createFieldImagefilterSigmoid(const Field &sourceField, double min, double max, double alpha, double beta)
Definition: fieldimageprocessing.hpp:811
int getComputeMinimumValues(int valuesCount, double *valuesOut)
Definition: fieldimageprocessing.hpp:324
FieldImagefilterThreshold castImagefilterThreshold()
Definition: fieldimageprocessing.hpp:827