CustusX  2021.04.21-dev+develop.337f9
An IGT application
cxImageEnveloper.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXMULTIVOLUMEBOUNDINGBOX_H
13 #define CXMULTIVOLUMEBOUNDINGBOX_H
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include "cxForwardDeclarations.h"
18 #include "cxVector3D.h"
19 #include "cxTransform3D.h"
20 #include <vector>
21 #include "cxImageParameters.h"
22 
23 namespace cx
24 {
25 
26 typedef boost::shared_ptr<class ImageEnveloper> ImageEnveloperPtr;
27 
36 class cxResourceVisualization_EXPORT ImageEnveloper
37 {
38 public:
39  static ImageEnveloperPtr create();
41  virtual ~ImageEnveloper() {}
42 
43  virtual void setImages(std::vector<ImagePtr> images);
44  virtual ImagePtr getEnvelopingImage();
45  void setMaxEnvelopeVoxels(long maxVoxels);
46 
47 private:
48  std::vector<ImagePtr> mImages;
49  long mMaxEnvelopeVoxels;
50 
51  ImageParameters reduceToNumberOfVoxels(ImageParameters box, long maxVoxels);
52  ImageParameters createEnvelopeParametersFromImage(ImagePtr img);
53  ImageParameters selectParametersWithSmallestExtent(ImageParameters a, ImageParameters b);
54  ImageParameters selectParametersWithFewestVoxels(ImageParameters a, ImageParameters b);
55  ImagePtr createEnvelopeFromParameters(ImageParameters box);
56  Eigen::Array3d getMinimumSpacingFromAllImages(Transform3D qMr);
57  Eigen::Array3d getTransformedSpacing(Eigen::Array3d spacing, Transform3D qMd);
58  int getMaxScalarRange();
59 };
60 
61 } // namespace cx
62 
63 #endif // CXMULTIVOLUMEBOUNDINGBOX_H
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
boost::shared_ptr< class ImageEnveloper > ImageEnveloperPtr
Namespace for all CustusX production code.