34 #include <QVBoxLayout>
35 #include <QPushButton>
39 #include <vtkImageData.h>
61 connect(mInteractiveCropper.get(), SIGNAL(changed()),
this, SLOT(cropperChangedSlot()));
63 QVBoxLayout* layout =
new QVBoxLayout(
this);
65 this->setToolTip(
"Interactive volume cropping");
67 QGroupBox* activeGroupBox =
new QGroupBox(
"Interactive cropper");
68 activeGroupBox->setToolTip(this->toolTip());
69 layout->addWidget(activeGroupBox);
70 QVBoxLayout* activeLayout =
new QVBoxLayout(activeGroupBox);
72 mUseCropperCheckBox =
new QCheckBox(
"Use Cropper");
73 mUseCropperCheckBox->setToolTip(
"Turn on cropping for the active volume.");
74 connect(mUseCropperCheckBox, SIGNAL(toggled(
bool)), mInteractiveCropper.get(), SLOT(useCropping(
bool)));
75 activeLayout->addWidget(mUseCropperCheckBox);
77 mShowBoxCheckBox =
new QCheckBox(
"Show box");
78 mShowBoxCheckBox->setToolTip(
"Show crop box in 3D view. This also turns on cropping for convenience.");
79 connect(mShowBoxCheckBox, SIGNAL(toggled(
bool)), mInteractiveCropper.get(), SLOT(showBoxWidget(
bool)));
80 activeLayout->addWidget(mShowBoxCheckBox);
82 mBoundingBoxDimensions =
new QLabel(
"?, ?, ?");
83 mBoundingBoxDimensions->setToolTip(
"The dimensions of the croppers boundingbox.");
84 activeLayout->addWidget(mBoundingBoxDimensions);
87 layout->addWidget(mBBWidget);
88 connect(mBBWidget, SIGNAL(changed()),
this, SLOT(boxValuesChanged()));
90 QPushButton* cropClipButton =
new QPushButton(
"Create new cropped volume");
91 cropClipButton->setToolTip(
"Create a new volume containing only the volume inside the crop box.");
92 connect(cropClipButton, SIGNAL(clicked()),
this, SLOT(cropClipButtonClickedSlot()));
93 layout->addWidget(cropClipButton);
97 this->cropperChangedSlot();
100 void CroppingWidget::boxValuesChanged()
102 mInteractiveCropper->setBoundingBox(mBBWidget->
getValue());
105 void CroppingWidget::cropperChangedSlot()
107 std::vector<int> dims = mInteractiveCropper->getDimensions();
112 mBoundingBoxDimensions->setText(dimensionText);
113 mUseCropperCheckBox->setChecked(mInteractiveCropper->getUseCropping());
114 mShowBoxCheckBox->setChecked(mInteractiveCropper->getShowBoxWidget());
116 mBBWidget->
setValue(mInteractiveCropper->getBoundingBox(), mInteractiveCropper->getMaxBoundingBox());
119 ImagePtr CroppingWidget::cropClipButtonClickedSlot()
QString qstring_cast(const T &val)
vtkImageDataPtr cropImage(vtkImageDataPtr input, IntBoundingBox3D cropbox)
boost::shared_ptr< class Image > ImagePtr
cxLogicManager_EXPORT ViewServicePtr viewService()
cxLogicManager_EXPORT PatientModelServicePtr patientService()