Page MenuHomePhabricator

platformproject: enable easy conversion of datatypes Point/Vector/Matrix from and to MITK
Closed, ResolvedPublic

Description

Oftentimes conversion from the representations of the primitive datatypes Point/Vector/Matrix of the following providers:

itk
vnl
Plain Old Datatype
vtk
OpenCV
Boost

to and from MITK are necessary. The goal of this platformproject is to create a versatile, unified and simple approach on how these conversions work from now on.

Event Timeline

New remote branch pushed: bug-15852-u3-tests_platformproject_scalartype_float_to_double

For the mitkDICOMLocaleTest and the mitkTestDICOMLoading, I needed to replace mitk::eps by a higher epsilon to solve a test errors due to float imprecision.

See commits
cff7ad5750ff3887d4acc715a6cd3f52702a146d
2915742891f7cba51b825a3476e9dcb66006622f

New remote branch pushed: bug-15852-u3-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u5-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u11-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u12-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u13-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u14-platformproject_scalartype_float_to_double

New remote branch pushed: bug-15852-u2-platformproject_enable_easy_conversion_of_datatypes

User wirkert has pushed new remote branch:

bug-15852-u3-platformproject_enable_easy_conversion_of_datatypes

User wirkert has pushed new remote branch:

bug-15852-u4-platformproject_enable_easy_conversion_of_datatypes

User wirkert has pushed new remote branch:

bug-15852-u4-platformproject_enable_easy_conversion_of_datatypes

mylyn/context/zip

User wirkert has pushed new remote branch:

bug-15852-u5-platformproject_enable_easy_conversion_of_datatypes

User wirkert has pushed new remote branch:

bug-15852-u6-platformproject_enable_easy_conversion_of_datatypes

User wirkert has pushed new remote branch:

bug-15852-u7-platformproject_enable_easy_conversion_of_datatypes

[d473b9]: Merge branch 'bug-15852-u7-platformproject_enable_easy_conversion_of_d

Merged commits:

2014-06-05 14:40:15 Sebastian Wirkert [2556a9]
Merge branch 'bug-15852-u6-platformproject_enable_easy_conversion_of_datatypes' into bug-15852-u7-platformproject_enable_easy_conversion_of_datatypes

Conflicts:
Core/Code/DataManagement/mitkAbstractTransformGeometry.h
Core/Code/DataManagement/mitkGeometry2D.cpp
Core/Code/DataManagement/mitkGeometry3D.cpp
Core/Code/DataManagement/mitkGeometry3D.h
Core/Code/Testing/mitkClippedSurfaceBoundsCalculatorTest.cpp
Core/Code/Testing/mitkGeometry3DTest.cpp
Core/Documentation/Doxygen/Concepts/GeometryOverview.dox
Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.cpp
Modules/Ext/Testing/mitkPlaneFitTest.cpp
Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.cpp
Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.cpp
Modules/IpPicSupport/Testing/mitkPicFileReaderTest.cpp
Modules/QtWidgetsExt/QmitkSliceWidget.cpp


2014-05-13 17:41:06 Sebastian Wirkert [27bfa0]
Merge branch 'bug-15852-u5-platformproject_enable_easy_conversion_of_datatypes' into bug-15852-u6-platformproject_enable_easy_conversion_of_datatypes


2014-05-09 16:09:47 Sebastian Wirkert [f20126]
Implemented changes discussed in code review. Now only thing pending is test under windows.


2014-05-09 11:42:40 Sebastian Wirkert [73d04d]
Merge branch 'bug-15852-u4-platformproject_enable_easy_conversion_of_datatypes' into bug-15852-u5-platformproject_enable_easy_conversion_of_datatypes

Conflicts:
Modules/QtWidgetsExt/QmitkHistogramJSWidget.cpp

Also fixed some incompatibilities which came by search/replace from mitkIndex3D to
itk::Index<3> (when index was in vector, oftentimes two >>).


2014-05-08 16:40:52 Sebastian Wirkert [9efadb]
fixed small typo in comment.


2014-04-23 10:38:45 Sebastian Wirkert [9b73f1]
Deleted OpenCV type conversion test as this one is tested by general array type
conversion tests anyways.


2014-04-23 09:32:21 Sebastian Wirkert [d9945c]
More documentation for plattformproject added to concepts under Low level MITK data types and their usage.


2014-04-22 12:00:29 Sebastian Wirkert [e1185c]
Added first version of documentation.


2014-04-22 10:38:36 Sebastian Wirkert [811fe8]
Added tests for mitkArray.h


2014-04-17 13:11:55 Sebastian Wirkert [9c7975]
Removed second version of ToArray since it is not really necessary
and cannot be adapted for Matrix.


2014-04-17 13:07:50 Sebastian Wirkert [8d5e0c]
Renamed vector and matrix tests and made them work.


2014-04-17 13:07:20 Sebastian Wirkert [673cc3]
Corrected equal method for point test.


2014-04-17 11:33:58 Sebastian Wirkert [fbc278]
Vector type conversion tests moved to CPPUnit format.


2014-04-17 10:50:46 Sebastian Wirkert [bde1c9]
Removed point operations (*/+-) because it showed ugly side effects.


2014-04-17 10:45:15 Sebastian Wirkert [4aaa1e]
Fixed errors in Point conversion test, now it works!


2014-04-17 10:29:32 Sebastian Wirkert [dd3009]
now CPPUnit version of point conversion tests compiles.


2014-04-17 10:29:08 Sebastian Wirkert [a3242b]
For some reason old header was in files.cmake.


2014-04-17 10:22:36 Sebastian Wirkert [4bd8bd]
New name for type conversion tests on points.


2014-04-17 10:21:48 Sebastian Wirkert [12739e]
Tried to switch to CPPUnit tests for point. Does not work yet.


2014-04-17 09:56:54 Sebastian Wirkert [e3a2ba]
Cleaning up and updating mitk::Point


2014-04-14 18:25:51 Sebastian Wirkert [a8b03c]
Renamed mitkOldTypeConversion.h to mitkVectorDeprecated.h and removed unnecessary includes from mitkTypes.h


2014-04-14 17:51:05 Sebastian Wirkert [39c979]
Moved Equal methods into the classes they are comparing
(e.g. Equal for Vectors in mitkVector.h)
Renamed mitkTypeConversions.h to mitkArray.h.


2014-04-14 11:34:01 Sebastian Wirkert [a2f9a3]
Created the new file mitkEqual.h which holds basic methods for equality tests.


2014-04-14 11:21:55 Sebastian Wirkert [f27afb]
Moved FillVector3D and 4D to mitkVector.h .
To discuss if we want to keep it in this general form. An alternate proposal
is included but commented out.


2014-04-14 11:19:56 Sebastian Wirkert [bdc7b8]
Renamed mitkTypeBasics.cpp to mitkConstants.cpp.


2014-04-11 15:09:57 Sebastian Wirkert [2d24c5]
In the last commit I also removed some point to vector conversion functions. I don't think these are necessary and they change the way mitk handles points (opposed to how itk does it).
In this commit are all the necessary changes to get the code running again.
Can also be viewed as a howto handle point / vector interactions.


2014-04-11 15:08:00 Sebastian Wirkert [1eaf29]
mitkTypeBasics was renamed to mitkConstants as discussed in MITK meeting.
Additonally, mitkTypes.h now holds correct include names for the two new file names mitkConstants.h and mitkQuaternion.h


2014-04-11 15:06:48 Sebastian Wirkert [f53690]
Last remaining typedef was put in its own file: mitkQuaternion.h


2014-04-11 12:00:30 Sebastian Wirkert [e99ead]
replaced mitk::ScalarNumericTraits with itk::Numericatraits<mitk::ScalarType>


2014-04-11 11:43:00 Sebastian Wirkert [4c9f5b]
Removed Index3D typedef, ContinousIndex typedef, FileserviceOption typedef and the last
few remaining instances of the Transform3D typedef


2014-04-08 17:23:51 Sebastian Wirkert [41f6be]
Replaced mitk::Transform by itk version to remove typedef.


2014-04-08 16:25:34 Sebastian Wirkert [990d83]
removed unnecessary constructor and added call by reference instead of call by value for other one.


2014-04-07 14:01:59 Sebastian Wirkert [238b7d]
Merge branch 'bug-15852-u3-platformproject_enable_easy_conversion_of_datatypes' into bug-15852-u4-platformproject_enable_easy_conversion_of_datatypes

Conflicts:
Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.cpp
Plugins/org.mitk.gui.qt.meshdecimation/documentation/Manual/QmitkMeshDecimation.dox


2014-04-01 10:08:41 Sebastian Wirkert [523ca1]
< eps instead of <= eps implemented for all equal methods.


2014-03-27 17:09:19 Sebastian Wirkert [529577]
Removed code duplications in Equal methods. This led defining two

elements equal if their absolute difference is smaller _or equal_ eps.

2014-03-27 14:53:42 Sebastian Wirkert [75ff22]
Merge branch
'bug-15852-u2-platformproject_enable_easy_conversion_of_datatypes' into
bug-15852-u3-platformproject_enable_easy_conversion_of_datatypes

Conflicts:
Core/Code/Common/mitkTesting.h
Core/Code/DataManagement/mitkApplicationCursor.h
Core/Code/DataManagement/mitkGenericLookupTable.h
Core/Code/DataManagement/mitkGenericProperty.h
Core/Code/DataManagement/mitkLevelWindow.h
Core/Code/DataManagement/mitkVector.h
Core/Code/Interactions/mitkMouseMovePointSetInteractor.h
Core/Code/Interactions/mitkNodeDepententPointSetInteractor.h
Core/Code/Interactions/mitkPointSetInteractor.h
Core/Code/Testing/files.cmake
Core/Code/files.cmake
Modules/ClippingTools/mitkClippingPlaneDeformationTool.h
Modules/ClippingTools/mitkClippingPlaneRotationTool.h
Modules/ClippingTools/mitkClippingPlaneTranslationTool.h
Modules/ContourModel/DataManagement/mitkContourElement.h
Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.h
Modules/IGT/Common/mitkTrackingTypes.h
Modules/IpPicSupport/mitkPicHelper.h
Modules/MitkExt/Algorithms/mitkAngleCorrectByPointFilter.h
Modules/MitkExt/Controllers/mitkMultiStepper.h
Modules/MitkExt/DataManagement/mitkCellOperation.h
Modules/MitkExt/Rendering/mitkEnhancedPointSetVtkMapper3D.h
Modules/MitkExt/Rendering/mitkSplineMapper2D.cpp
Modules/ToFProcessing/mitkToFTestingCommon.h


2014-03-25 11:22:23 Sebastian Wirkert [08ada2]
outsourced all opencv specific type tests to own file.


2013-12-13 15:26:56 Sebastian Wirkert [b37666]

Added comments for operator/ and operator*

2013-12-13 15:22:02 Sebastian Wirkert [23b92d]

Added scalar multiplication and division for points.

2013-11-19 16:24:54 Sebastian Wirkert [d8ce49]

little changes to interface for point addition, subtraction.

2013-11-19 15:19:21 Sebastian Wirkert [357fcb]

Preliminary version to allow a = add(c, d);

2013-11-12 11:39:48 Sebastian Wirkert [0f255d]

  1. Some more documentation
  2. Made constructors explicit as far as possible without breaking code

(talk with Sascha about this, since itk::Vector constructors are not
explicit).

  1. Removed unnecessary equal in TypeVectorConversionTest. ------------------------------------------------------------------

2013-11-12 10:41:33 Sebastian Wirkert [5e987e]

Roughly the same as in last commit for FromArray done for ToArray.

2013-11-11 18:20:39 Sebastian Wirkert [afb876]
ToArray done equivalently to FromArray (see last checkin).

TODO: What to do with converting to POD?

2013-11-11 17:25:41 Sebastian Wirkert [a89182]
Interface change so that FromArray can be invoked directly onto a

vector.

2013-11-11 14:15:49 Sebastian Wirkert [b383a6]
Merge branch
'bug-15852-platformproject_enable_easy_conversion_of_datatypes' into
bug-15852-u2-platformproject_enable_easy_conversion_of_datatypes

Conflicts:
Core/Code/DataManagement/itkVtkAbstractTransform.txx
Core/Code/DataManagement/mitkDataTypeBasics.h
Core/Code/DataManagement/mitkPoint.h
Core/Code/DataManagement/mitkTypeBasics.cpp
Core/Code/DataManagement/mitkTypeBasics.h
Core/Code/DataManagement/mitkVector.cpp
Core/Code/DataManagement/mitkVector.h
Core/Code/Testing/files.cmake
Core/Code/Testing/mitkSurfaceToSurfaceFilterTest.cpp
Core/Code/Testing/mitkTypeOperationTest.cpp
Core/Code/Testing/mitkTypePointConversionTest.cpp
Core/Code/files.cmake
Modules/ContourModel/DataManagement/mitkContourElement.h
Modules/MitkExt/DataManagement/mitkVecmathHelper.h
Modules/MitkExt/Interactions/mitkTDMouseEventThrower.cpp
Modules/Segmentation/DataManagement/mitkContour.h
Modules/Simulation/mitkSimulationService.h


2013-10-17 13:56:14 Sebastian Wirkert [6baaab]
Merge branch 'bug-15852-platformproject_enable_easy_conversion_of_datatypes' of mitk.org:MITK into bug-15852-platformproject_enable_easy_conversion_of_datatypes


2013-10-09 13:29:04 Sebastian Wirkert [b154b6]
Very small formatting change.


2013-10-01 14:46:59 Alfred Franz [a04b6e]
fixed typo


2013-09-25 10:54:23 Sebastian Wirkert [817b06]
Feedback from Sascha: Implemented ToArray and FromArray as free-floating
template functions so they can by specialized by users in case they want

to copy to an ArrayType which does not implement operator[]

2013-09-24 17:57:43 Sebastian Wirkert [08215b]
The multiplication and division method as implemented made no sense.
Switched them out to be able to multipy/divide itk::FixedArrays with

scalars.

2013-09-24 17:34:50 Sebastian Wirkert [a9955e]

put type operations into namespace mitk.

2013-09-24 17:16:07 Sebastian Wirkert [1edf54]

Added div mul and sub methods + tests.

2013-09-24 16:25:52 Sebastian Wirkert [10ee6f]
Added an example how +/-/*/: operations could look like for arbitrary

itk::FixedArrays.

2013-09-23 15:21:39 Sebastian Wirkert [a3eca2]

some small changes in the comments.

2013-09-23 14:58:19 Sebastian Wirkert [4ee53a]
Removed conversions of not equal types (e.g.: vector3F = vector3D), as
it is no longer desired after discussing this requirement with Alfred
and Sascha.

Also, some further tidying up of mitkTypeVectorConversionTest.

2013-09-23 14:19:34 Sebastian Wirkert [90f01d]

More refractoring to using new convenience method TestForEquality.

2013-09-23 14:05:34 Sebastian Wirkert [b2c775]
First version which assigns opencv vectors by trying out new templated
FromArray and ToArray functions.
Also began some restructuring to make tests less redundant and less

readable.

2013-09-19 16:58:04 Sebastian Wirkert [c5f4d5]

Tidied up.

2013-09-19 16:23:03 Sebastian Wirkert [5ed252]
Removed capability to assign differently sized vectors and replaced it
with an exception in case the dimensionality does not match as discussed

with Alfred.

2013-09-19 15:51:32 Sebastian Wirkert [49ff64]

First version which also converts vnl_vector <-> mitk::Vector

2013-09-13 14:01:49 Sebastian Wirkert [078d51]
Added functionality to convert between different datatypes.
E.g.:

vector3F = vector3D

2013-09-12 11:14:20 Sebastian Wirkert [adf63c]
Added user-defined conversion from mitk::Vector to vnl_vector_fixed.

Added a convenience EqualArray method.

2013-09-09 17:40:50 Sebastian Wirkert [ee1f0b]
Refactored static function names +
added one test to ensure correct conversion between

mitk::Vector<float, 3> 2 itk::Vector<double, 3>

2013-09-09 17:31:59 Sebastian Wirkert [e96ed2]
Added functionality to convert between different types
(e.g., itk::Vector<float,3> to mitk::Vector<double,3>

+ tests.

2013-09-09 16:36:34 Sebastian Wirkert [92ed8c]
Tests for vnl_vector constructor corner cases added (vnl_vector bigger

or smaller in size than mitk::Vector.

2013-09-09 16:23:14 Sebastian Wirkert [f51207]

Started work on mitk 2 vnl conversions.

2013-08-23 18:08:42 Sebastian Wirkert [895847]
First two tests for new mitk::Vector added.


2013-08-23 17:56:44 Sebastian Wirkert [b25bc8]
Split up mitkTypConversionTest into for test files one for Point, Vector and Matrix.


2013-08-23 17:23:13 Sebastian Wirkert [25b45b]
Made Matrix its own class.


2013-08-23 12:57:53 Sebastian Wirkert [dec599]
Made Vector its own class and added one typedef from keno.


2013-08-23 11:00:38 Sebastian Wirkert [8172ba]
correct names for files.cmake added.


2013-08-23 10:42:46 Sebastian Wirkert [0710e4]
Removed unnecessary includes in point and general cleanup in the basic types section.


2013-08-23 10:37:13 Sebastian Wirkert [8e3b35]
Renamed mitkDataTypeBasics to mitkTypeBasics
Added one file for basic mitk typedefs: mitkTypdefs.h and
one file for the "old style conversions" which will be deprecated after this
platformproject.


2013-08-23 10:12:59 Sebastian Wirkert [e32df6]
Changed name from central mitk types (Point, Vector, Matrix, ...)
file from mitkVector.h to mitkTypes.h

done by global search replace on "mitkVector.h" and <mitkVector.h>


2013-08-22 16:00:14 Sebastian Wirkert [d873be]
Changes to make it run with gcc.

[0a0261]: Merge branch 'bug-15852-reduce-gcc-memory-consumption'

Merged commits:

2014-06-13 15:51:07 Sascha Zelzer [8de163]
Rewrote some code to reduce gcc memory consumption.

In release mode, gcc 4.8.2 happily consumes several GB of memory when
compiling mitkUndistortCameraImage.cpp which could result in a memory
allocation failure. This rewrite seems to avoid this issue.

[d6f7e3]: Merge branch 'bug-15852-fix-gcc43-uninitialized-warnings'

Merged commits:

2014-06-14 00:08:06 Sascha Zelzer [a52329]
Fix 'may be used uninitialized' warnings with gcc 4.3.

User zelzer has pushed new remote branch:

bug-15852-fix-gcc43-uninitialized-warnings