|
NorMIT-nav
22.09
An IGT application
|
Go to the documentation of this file.
14 #include <QApplication>
18 #include "vtkImageData.h"
39 return "resample_image_filter";
46 "<p><i>Resample the volume into the space of the reference volume. Also crop to the same volume.</i></p>"
53 "mm Margin added to ref image bounding box",
67 temp->setValueName(
"Input");
68 temp->setHelp(
"Select input to be resampled");
72 temp->setValueName(
"Reference");
73 temp->setHelp(
"Select reference. Resample input into this coordinate system and bounding box");
82 temp->setValueName(
"Output");
83 temp->setHelp(
"Output thresholded binary image");
101 if (!input || !reference)
105 double margin = marginOption->getValue();
107 Transform3D refMi = reference->get_rMd().inv() * input->get_rMd();
110 Transform3D orient_M_ref = oriented->get_rMd().inv() * reference->get_rMd();
114 bb_crop[0] -= margin;
115 bb_crop[1] += margin;
116 bb_crop[2] -= margin;
117 bb_crop[3] += margin;
118 bb_crop[4] -= margin;
119 bb_crop[5] += margin;
121 oriented->setCroppingBox(bb_crop);
125 QString uid = input->getUid() +
"_resample%1";
126 QString name = input->getName() +
" resample%1";
131 resampled->moveThisAndChildrenToThread(QApplication::instance()->thread());
133 mRawResult = resampled;
144 mServices->patient()->insertData(output);
virtual void createOptions()
ImagePtr resampleImage(PatientModelServicePtr dataManager, ImagePtr image, Transform3D qMd)
static StringPropertySelectDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
vtkImageDataPtr cropImage(vtkImageDataPtr input, IntBoundingBox3D cropbox)
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,...
virtual QString getHelp() const
Namespace for all CustusX production code.
virtual bool postProcess()
boost::shared_ptr< class VisServices > VisServicesPtr
std::vector< SelectDataStringPropertyBasePtr > mOutputTypes
virtual QString getType() const
std::vector< SelectDataStringPropertyBasePtr > mInputTypes
virtual void createInputTypes()
QDomElement mCopiedOptions
ImagePtr getCopiedInputImage(int index=0)
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
virtual void createOutputTypes()
static StringPropertySelectImagePtr New(PatientModelServicePtr patientModelService)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
ResampleImageFilter(VisServicesPtr services)
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
Utility class for describing a bounded numeric range.
virtual QString getName() const
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
DoublePropertyPtr getMarginOption(QDomElement root)
std::vector< PropertyPtr > mOptionsAdapters
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr