void ActiveImageProxy::activeImageChangedSlot(const QString& uid) { if (mImage && mImage->getUid() == uid) return; if (mImage) { disconnect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); disconnect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString))); disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString))); disconnect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged())); disconnect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged())); disconnect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); disconnect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); } mImage = mActiveData->getActive<Image>(); if (mImage) { connect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); connect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); connect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString))); connect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString))); connect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged())); connect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged())); connect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); connect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); } }
UnsignedDerivedImage::UnsignedDerivedImage(ImagePtr base) : Image(base->getUid()+"_u", vtkImageDataPtr(), base->getName()) { this->mBase = base; // redirected signals: connect(base.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); connect(base.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); connect(base.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); connect(base.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); // override signals: connect(base.get(), SIGNAL(transferFunctionsChanged()), this, SLOT(unsignedTransferFunctionsChangedSlot())); connect(base.get(), SIGNAL(vtkImageDataChanged()), this, SLOT(unsignedImageChangedSlot())); connect(this, SIGNAL(transferFunctionsChanged()), this, SLOT(testSlot())); this->unsignedImageChangedSlot(); this->unsignedTransferFunctionsChangedSlot(); }
void Image::startThresholdPreview(const Eigen::Vector2d &threshold) { mThresholdPreview = true; this->createThresholdPreviewTransferFunctions3D(threshold); this->createThresholdPreviewLookupTable2D(threshold); emit transferFunctionsChanged(); }
void Image::resetTransferFunction(ImageTF3DPtr imageTransferFunctions3D, ImageLUT2DPtr imageLookupTable2D) { this->blockSignals(true); // avoid emitting two transferFunctionsChanged() for one call. this->resetTransferFunction(imageTransferFunctions3D); this->resetTransferFunction(imageLookupTable2D); this->blockSignals(false); emit transferFunctionsChanged(); }
void Image::stopThresholdPreview() { mThresholdPreview = false; mTresholdPreviewTransferfunctions3D.reset(); mTresholdPreviewLookupTable2D.reset(); //Need to tag these transfer functions as modified to tell the VTK pipeline that we got new TFs this->getTransferFunctions3D()->getColorTF()->Modified(); this->getTransferFunctions3D()->getOpacityTF()->Modified(); emit transferFunctionsChanged(); }
TransferFunctionAlphaWidget::TransferFunctionAlphaWidget(ActiveDataPtr activeData, QWidget* parent) : BaseWidget(parent, "TransferFunctionAlphaWidget", "Alpha Transfer Function"), mBorder(5), mReadOnly(false) { this->setToolTip("Set the alpha part of a transfer function"); this->setFocusPolicy(Qt::StrongFocus); mActiveImageProxy = ActiveImageProxy::New(activeData); connect(mActiveImageProxy.get(), SIGNAL(transferFunctionsChanged()), this, SLOT(activeImageTransferFunctionsChangedSlot())); mSelectedAlphaPoint.reset(); }
void Image::resetTransferFunction(ImageTF3DPtr imageTransferFunctions3D) { if (mImageTransferFunctions3D) { disconnect(mImageTransferFunctions3D.get(), &ImageTFData::transferFunctionsChanged, this, &Image::transferFunctionsChanged); } mImageTransferFunctions3D = imageTransferFunctions3D; if (mImageTransferFunctions3D) { connect(mImageTransferFunctions3D.get(), &ImageTFData::transferFunctionsChanged, this, &Image::transferFunctionsChanged); } emit transferFunctionsChanged(); }
void Image::resetTransferFunction(ImageLUT2DPtr imageLookupTable2D) { if (mImageLookupTable2D) { disconnect(mImageLookupTable2D.get(), &ImageTFData::transferFunctionsChanged, this, &Image::transferFunctionsChanged); } mImageLookupTable2D = imageLookupTable2D; if (mImageLookupTable2D) { connect(mImageLookupTable2D.get(), &ImageTFData::transferFunctionsChanged, this, &Image::transferFunctionsChanged); } emit transferFunctionsChanged(); }
void Image::setShading(Image::ShadingStruct shading) { mShading = shading; emit transferFunctionsChanged(); }
void Image::setShadingSpecularPower(double specularPower) { mShading.specularPower = specularPower; emit transferFunctionsChanged(); }
void Image::setShadingDiffuse(double diffuse) { mShading.diffuse = diffuse; emit transferFunctionsChanged(); }
void Image::setShadingAmbient(double ambient) { mShading.ambient = ambient; emit transferFunctionsChanged(); }
void Image::setShadingOn(bool on) { mShading.on = on; emit transferFunctionsChanged(); }