OpenCMISS-Zinc C++ API Documentation
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 "opencmiss/zinc/field.hpp"
13 #include "opencmiss/zinc/fieldimageprocessing.h"
14 #include "opencmiss/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 };
150 {
151 
152 private:
153  explicit FieldImagefilterCannyEdgeDetection(cmzn_field_id field_id) : Field(field_id)
154  { }
155 
158  double variance, double maximumError, double upperThreshold, double lowerThreshold);
159 
160 public:
161 
163  { }
164 
165 };
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 
184  double lowerThreshold, double upperThreshold, double replaceValue,
185  int dimension, int seedPointsCount, const double *seedPoints);
186 
187 public:
188 
190  { }
191 
192 };
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 
212  double timeStep, double conductance, int numIterations);
213 
214 public:
215 
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 };
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 
476  double sigma);
477 
478 public:
479 
481  { }
482 
483 };
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 
502  double outputMin, double outputMax);
503 
504 public:
505 
507  { }
508 
509 };
510 
511 class FieldImagefilterMean : public Field
519 {
520 
521 private:
522  // takes ownership of C handle, responsibility for destroying it
523  explicit FieldImagefilterMean(cmzn_field_id field_id) : Field(field_id)
524  { }
525 
526  friend FieldImagefilterMean
528  int radiusSizesCount, const int *radiusSizesIn);
529 
530 public:
531 
533  { }
534 
535 };
536 class FieldImagefilterSigmoid : public Field
545 {
546 
547 private:
548  // takes ownership of C handle, responsibility for destroying it
549  explicit FieldImagefilterSigmoid(cmzn_field_id field_id) : Field(field_id)
550  { }
551 
554  double min, double max, double alpha, double beta);
555 
556 public:
557 
559  { }
560 
561 };
562 
563 
570 {
571 public:
572 
574  { }
575 
576  // takes ownership of C handle, responsibility for destroying it
577  explicit FieldImagefilterThreshold(cmzn_field_imagefilter_threshold_id field_imagefilter_threshold_id) :
578  Field(reinterpret_cast<cmzn_field_id>(field_imagefilter_threshold_id))
579  { }
580 
586  {
587  CONDITION_INVALID = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_INVALID,
589  CONDITION_ABOVE = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_ABOVE,
591  CONDITION_BELOW = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_BELOW,
594  CONDITION_OUTSIDE = CMZN_FIELD_IMAGEFILTER_THRESHOLD_CONDITION_OUTSIDE
596  };
597 
603  enum Condition getCondition()
604  {
605  return static_cast<Condition>(cmzn_field_imagefilter_threshold_get_condition(
606  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id)));
607  }
608 
617  int setCondition(Condition condition)
618  {
619  return cmzn_field_imagefilter_threshold_set_condition(
620  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id),
621  static_cast<cmzn_field_imagefilter_threshold_condition>(condition));
622  }
623 
630  {
631  return cmzn_field_imagefilter_threshold_get_outside_value(
632  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
633  }
634 
641  int setOutsideValue(double outsideValue)
642  {
643  return cmzn_field_imagefilter_threshold_set_outside_value(
644  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), outsideValue);
645  }
646 
653  {
654  return cmzn_field_imagefilter_threshold_get_lower_threshold(
655  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
656  }
657 
666  int setLowerThreshold(double lowerValue)
667  {
668  return cmzn_field_imagefilter_threshold_set_lower_threshold(
669  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), lowerValue);
670  }
671 
678  {
679  return cmzn_field_imagefilter_threshold_get_upper_threshold(
680  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id));
681  }
682 
691  int setUpperThreshold(double upperValue)
692  {
693  return cmzn_field_imagefilter_threshold_set_upper_threshold(
694  reinterpret_cast<cmzn_field_imagefilter_threshold_id>(id), upperValue);
695  }
696 
697 };
698 
701  int radius, double dilate_value)
702 {
704  cmzn_fieldmodule_create_field_imagefilter_binary_dilate(id, sourceField.getId(),
705  radius, dilate_value));
706 }
707 
710  int radius, double erode_value)
711 {
713  cmzn_fieldmodule_create_field_imagefilter_binary_erode(id, sourceField.getId(),
714  radius, erode_value));
715 }
716 
719 {
720  return FieldImagefilterBinaryThreshold(reinterpret_cast<cmzn_field_imagefilter_binary_threshold_id>(
721  cmzn_fieldmodule_create_field_imagefilter_binary_threshold(id, sourceField.getId())));
722 }
723 
725 {
726  return FieldImagefilterBinaryThreshold(cmzn_field_cast_imagefilter_binary_threshold(id));
727 }
728 
731  double variance, double maximumError, double upperThreshold, double lowerThreshold)
732 {
734  cmzn_fieldmodule_create_field_imagefilter_canny_edge_detection(
735  id, sourceField.getId(),
736  variance, maximumError, upperThreshold, lowerThreshold));
737 }
738 
741  double lowerThreshold, double upperThreshold, double replaceValue,
742  int dimension, int seedPointsCount, const double *seedPoints)
743 {
745  cmzn_fieldmodule_create_field_imagefilter_connected_threshold(id, sourceField.getId(),
746  lowerThreshold, upperThreshold, replaceValue, seedPointsCount, dimension, seedPoints));
747 }
748 
751  double timeStep, double conductance, int numIterations)
752 {
754  cmzn_fieldmodule_create_field_imagefilter_curvature_anisotropic_diffusion(id, sourceField.getId(),
755  timeStep, conductance, numIterations));
756 }
757 
760 {
761  return FieldImagefilterDiscreteGaussian(reinterpret_cast<cmzn_field_imagefilter_discrete_gaussian_id>(
762  cmzn_fieldmodule_create_field_imagefilter_discrete_gaussian(id, sourceField.getId())));
763 }
764 
766 {
767  return FieldImagefilterDiscreteGaussian(cmzn_field_cast_imagefilter_discrete_gaussian(id));
768 }
769 
772  double sigma)
773 {
775  cmzn_fieldmodule_create_field_imagefilter_gradient_magnitude_recursive_gaussian(id,
776  sourceField.getId(), sigma));
777 }
778 
781 {
782  return FieldImagefilterHistogram(reinterpret_cast<cmzn_field_imagefilter_histogram_id>(
783  cmzn_fieldmodule_create_field_imagefilter_histogram(id, sourceField.getId())));
784 }
785 
787 {
788  return FieldImagefilterHistogram(cmzn_field_cast_imagefilter_histogram(id));
789 }
790 
793  double outputMin, double outputMax)
794 {
796  cmzn_fieldmodule_create_field_imagefilter_rescale_intensity(id,
797  sourceField.getId(), outputMin, outputMax));
798 }
799 
801  int radiusSizesCount, const int *radiusSizesIn)
802 {
803  return FieldImagefilterMean(cmzn_fieldmodule_create_field_imagefilter_mean(
804  id, sourceField.getId(), radiusSizesCount, radiusSizesIn));
805 }
806 
809  double min, double max, double alpha, double beta)
810 {
812  cmzn_fieldmodule_create_field_imagefilter_sigmoid(id,
813  sourceField.getId(), min, max, alpha, beta));
814 }
815 
818 {
819  return FieldImagefilterThreshold(reinterpret_cast<cmzn_field_imagefilter_threshold_id>(
820  cmzn_fieldmodule_create_field_imagefilter_threshold(
821  id, sourceField.getId())));
822 }
823 
825 {
826  return FieldImagefilterThreshold(cmzn_field_cast_imagefilter_threshold(id));
827 }
828 
829 } // namespace Zinc
830 }
831 
832 #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:730
FieldImagefilterMean createFieldImagefilterMean(const Field &sourceField, int radiusSizesCount, const int *radiusSizesIn)
Definition: fieldimageprocessing.hpp:800
FieldImagefilterDiscreteGaussian castImagefilterDiscreteGaussian()
Definition: fieldimageprocessing.hpp:765
int setOutsideValue(double outsideValue)
Definition: fieldimageprocessing.hpp:641
FieldImagefilterDiscreteGaussian createFieldImagefilterDiscreteGaussian(const Field &sourceField)
Definition: fieldimageprocessing.hpp:759
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:51
FieldImagefilterBinaryDilate createFieldImagefilterBinaryDilate(const Field &sourceField, int radius, double dilate_value)
Definition: fieldimageprocessing.hpp:700
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:750
int setVariance(double variance)
Definition: fieldimageprocessing.hpp:260
int setCondition(Condition condition)
Definition: fieldimageprocessing.hpp:617
int getNumberOfBins(int valuesCount, int *valuesOut)
Definition: fieldimageprocessing.hpp:397
FieldImagefilterBinaryErode createFieldImagefilterBinaryErode(const Field &sourceField, int radius, double erode_value)
Definition: fieldimageprocessing.hpp:709
FieldImagefilterHistogram createFieldImagefilterHistogram(const Field &sourceField)
Definition: fieldimageprocessing.hpp:780
FieldImagefilterRescaleIntensity createFieldImagefilterRescaleIntensity(const Field &sourceField, double outputMin, double outputMax)
Definition: fieldimageprocessing.hpp:792
double getLowerThreshold()
Definition: fieldimageprocessing.hpp:97
double getUpperThreshold()
Definition: fieldimageprocessing.hpp:677
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:103
Condition
Definition: fieldimageprocessing.hpp:585
double getOutsideValue()
Definition: fieldimageprocessing.hpp:629
int setUpperThreshold(double upperValue)
Definition: fieldimageprocessing.hpp:691
FieldImagefilterConnectedThreshold createFieldImagefilterConnectedThreshold(const Field &sourceField, double lowerThreshold, double upperThreshold, double replaceValue, int dimension, int seedPointsCount, const double *seedPoints)
Definition: fieldimageprocessing.hpp:740
A field performing ITK mean image filter on source_field image.
Definition: fieldimageprocessing.hpp:518
int setUpperThreshold(double upperThreshold)
Definition: fieldimageprocessing.hpp:133
FieldImagefilterHistogram castImagefilterHistogram()
Definition: fieldimageprocessing.hpp:786
Image processing derived field type performing the ITK threshold filter.
Definition: fieldimageprocessing.hpp:569
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:666
FieldImagefilterThreshold createFieldImagefilterThreshold(const Field &sourceField)
Definition: fieldimageprocessing.hpp:817
A field performing ITK binary erode image filter on scalar source field image.
Definition: fieldimageprocessing.hpp:57
double getLowerThreshold()
Definition: fieldimageprocessing.hpp:652
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:544
FieldImagefilterBinaryThreshold createFieldImagefilterBinaryThreshold(const Field &sourceField)
Definition: fieldimageprocessing.hpp:718
The OpenCMISS namespace.
Definition: context.hpp:20
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:771
FieldImagefilterBinaryThreshold castImagefilterBinaryThreshold()
Definition: fieldimageprocessing.hpp:724
int setMaxKernelWidth(int maxKernelWidth)
Definition: fieldimageprocessing.hpp:288
FieldImagefilterSigmoid createFieldImagefilterSigmoid(const Field &sourceField, double min, double max, double alpha, double beta)
Definition: fieldimageprocessing.hpp:808
int getComputeMinimumValues(int valuesCount, double *valuesOut)
Definition: fieldimageprocessing.hpp:324
FieldImagefilterThreshold castImagefilterThreshold()
Definition: fieldimageprocessing.hpp:824