NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxVolumeHelpers.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 CXVOLUMEHELPERS_H_
13 #define CXVOLUMEHELPERS_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include <map>
18 #include "cxVector3D.h"
19 #include "vtkForwardDeclarations.h"
20 #include "cxBoundingBox3D.h"
21 #include "cxTransform3D.h"
22 #include "cxForwardDeclarations.h"
23 
24 namespace cx
25 {
26 typedef boost::shared_ptr<class Image> ImagePtr;
27 typedef boost::shared_ptr<class Data> DataPtr;
28 
34 cxResource_EXPORT vtkImageDataPtr generateVtkImageData(Eigen::Array3i dim, Vector3D spacing, const unsigned char initValue, int components = 1);
35 cxResource_EXPORT vtkImageDataPtr generateVtkImageDataUnsignedShort(Eigen::Array3i dim,
36  Vector3D spacing,
37  const unsigned short initValue,
38  int components = 1);
39 cxResource_EXPORT vtkImageDataPtr generateVtkImageDataSignedShort(Eigen::Array3i dim,
40  Vector3D spacing,
41  const short initValue,
42  int components = 1);
43 cxResource_EXPORT vtkImageDataPtr generateVtkImageDataDouble(Eigen::Array3i dim, Vector3D spacing, double initValue);
44 cxResource_EXPORT void fillShortImageDataWithGradient(vtkImageDataPtr data, int maxValue);
45 cxResource_EXPORT ImagePtr createDerivedImage(PatientModelServicePtr dataManager, QString uid, QString name, vtkImageDataPtr raw, ImagePtr parent);
46 
47 
57 cxResource_EXPORT ImagePtr convertImageToUnsigned(PatientModelServicePtr dataManager, ImagePtr image, vtkImageDataPtr suggestedConvertedVolume = vtkImageDataPtr(), bool verbose = true);
58 
59 cxResource_EXPORT std::map<std::string, std::string> getDisplayFriendlyInfo(ImagePtr image);
60 cxResource_EXPORT std::map<std::string, std::string> getDisplayFriendlyInfo(vtkImageDataPtr image);
61 cxResource_EXPORT void printDisplayFriendlyInfo(std::map<std::string, std::string> map);
62 
63 cxResource_EXPORT int calculateNumVoxelsWithMaxValue(ImagePtr image);
64 cxResource_EXPORT int calculateNumVoxelsWithMinValue(ImagePtr image);
65 
66 cxResource_EXPORT DoubleBoundingBox3D findEnclosingBoundingBox(std::vector<DataPtr> data, Transform3D qMr = Transform3D::Identity());
67 cxResource_EXPORT DoubleBoundingBox3D findEnclosingBoundingBox(std::vector<ImagePtr> data, Transform3D qMr = Transform3D::Identity());
68 
69 
72 
73 cxResource_EXPORT vtkImageDataPtr convertImageDataTo8Bit(vtkImageDataPtr image, double windowWidth, double windowLevel);
74 
81 cxResource_EXPORT void setDeepModified(vtkImageDataPtr image);
82 
83 
88 }
89 
90 
91 #endif /* CXVOLUMEHELPERS_H_ */
cx::setDeepModified
void setDeepModified(vtkImageDataPtr image)
Definition: cxVolumeHelpers.cpp:408
cx::generateVtkImageDataUnsignedShort
vtkImageDataPtr generateVtkImageDataUnsignedShort(Eigen::Array3i dim, Vector3D spacing, const unsigned short initValue, int components)
Definition: cxVolumeHelpers.cpp:92
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::getDisplayFriendlyInfo
std::map< std::string, std::string > getDisplayFriendlyInfo(MeshPtr mesh)
Definition: cxMeshHelpers.cpp:72
cxForwardDeclarations.h
cx::convertImageToUnsigned
ImagePtr convertImageToUnsigned(PatientModelServicePtr dataManager, ImagePtr image, vtkImageDataPtr suggestedConvertedVolume, bool verbose)
Definition: cxVolumeHelpers.cpp:169
vtkImageDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Definition: cxVideoConnectionWidget.h:30
cx::calculateNumVoxelsWithMinValue
int calculateNumVoxelsWithMinValue(ImagePtr image)
Find number of voxels containing min scalar value.
Definition: cxVolumeHelpers.cpp:308
cxBoundingBox3D.h
cxVector3D.h
cx::fillShortImageDataWithGradient
void fillShortImageDataWithGradient(vtkImageDataPtr data, int maxValue)
Definition: cxVolumeHelpers.cpp:115
cx::generateVtkImageData
vtkImageDataPtr generateVtkImageData(Eigen::Array3i dim, Vector3D spacing, const unsigned char initValue, int components)
Definition: cxVolumeHelpers.cpp:84
cx::generateVtkImageDataSignedShort
vtkImageDataPtr generateVtkImageDataSignedShort(Eigen::Array3i dim, Vector3D spacing, const short initValue, int components)
Definition: cxVolumeHelpers.cpp:100
cx::findEnclosingBoundingBox
DoubleBoundingBox3D findEnclosingBoundingBox(std::vector< DataPtr > data, Transform3D qMr)
Definition: cxVolumeHelpers.cpp:313
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
vtkForwardDeclarations.h
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::printDisplayFriendlyInfo
void printDisplayFriendlyInfo(std::map< std::string, std::string > map)
Definition: cxVolumeHelpers.cpp:292
cx::createDerivedImage
ImagePtr createDerivedImage(PatientModelServicePtr dataManager, QString uid, QString name, vtkImageDataPtr raw, ImagePtr parent)
Definition: cxVolumeHelpers.cpp:151
cx::convertFrom4To3Components
vtkImageDataPtr convertFrom4To3Components(vtkImageDataPtr image)
Definition: cxVolumeHelpers.cpp:365
cx::calculateNumVoxelsWithMaxValue
int calculateNumVoxelsWithMaxValue(ImagePtr image)
Find number of voxels containing max scalar value.
Definition: cxVolumeHelpers.cpp:304
cx::convertImageDataTo8Bit
vtkImageDataPtr convertImageDataTo8Bit(vtkImageDataPtr image, double windowWidth, double windowLevel)
Have never been used or tested. Create a test for it.
Definition: cxVolumeHelpers.cpp:383
cx::convertImageDataToGrayScale
vtkImageDataPtr convertImageDataToGrayScale(vtkImageDataPtr image)
Definition: cxVolumeHelpers.cpp:347
cx::generateVtkImageDataDouble
vtkImageDataPtr generateVtkImageDataDouble(Eigen::Array3i dim, Vector3D spacing, double initValue)
Definition: cxVolumeHelpers.cpp:108
cxTransform3D.h
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42