14 #include <vtkImageData.h> 15 #include <vtkImageReslice.h> 16 #include <vtkMatrix4x4.h> 18 #include <vtkImageResample.h> 19 #include <vtkImageClip.h> 46 orientator->SetInputData(image->getBaseVtkImageData());
47 orientator->SetInterpolationModeToLinear();
48 orientator->SetOutputDimensionality(3);
49 orientator->SetResliceAxes(qMd.inv().getVtkMatrix());
50 orientator->AutoCropOutputOn();
56 QString uid = image->getUid() +
"_or%1";
57 QString name = image->getName()+
" or%1";
64 oriented->get_rMd_History()->setRegistration(image->get_rMd() * qMd.inv());
65 oriented->mergevtkSettingsIntosscTransform();
76 resampler->SetInputData(image->getBaseVtkImageData());
77 resampler->SetAxisOutputSpacing(0, spacing[0]);
78 resampler->SetAxisOutputSpacing(1, spacing[1]);
79 resampler->SetAxisOutputSpacing(2, spacing[2]);
85 uid = image->getUid() +
"_res%1";
86 name = image->getName()+
" res%1";
100 Vector3D spacing(image->getBaseVtkImageData()->GetSpacing());
101 return resampleImage(dataManager, image, spacing, image->getUid()+
"_copy%1", image->getName()+
" copy%1");
110 clip->SetInputData(input);
111 clip->SetOutputWholeExtent(cropbox.begin());
118 rawResult->ComputeBounds();
128 double* sp = image->getBaseVtkImageData()->GetSpacing();
130 static_cast<int>(bb[0]/sp[0]+0.5), static_cast<int>(bb[1]/sp[0]+0.5),
131 static_cast<int>(bb[2]/sp[1]+0.5), static_cast<int>(bb[3]/sp[1]+0.5),
132 static_cast<int>(bb[4]/sp[2]+0.5), static_cast<int>(bb[5]/sp[2]+0.5));
135 QString uid = image->getUid() +
"_crop%1";
136 QString name = image->getName()+
" crop%1";
140 result->mergevtkSettingsIntosscTransform();
150 QRegExp tsReg(
"[0-9]{8}T[0-9]{6}");
151 if (tsReg.indexIn(text)>0)
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
ImagePtr resampleImage(PatientModelServicePtr dataManager, ImagePtr image, Transform3D qMd)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
vtkImageDataPtr cropImage(vtkImageDataPtr input, IntBoundingBox3D cropbox)
boost::shared_ptr< class Image > ImagePtr
QString timestampSecondsFormat()
ImagePtr duplicateImage(PatientModelServicePtr dataManager, ImagePtr image)
ImagePtr createDerivedImage(PatientModelServicePtr dataManager, QString uid, QString name, vtkImageDataPtr raw, ImagePtr parent)
vtkSmartPointer< class vtkImageReslice > vtkImageReslicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Representation of an integer bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
vtkSmartPointer< class vtkImageResample > vtkImageResamplePtr
vtkSmartPointer< class vtkImageClip > vtkImageClipPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
QDateTime extractTimestamp(QString text)
Namespace for all CustusX production code.