void GraphicalGeometricBase::setSource(vtkPolyDataAlgorithmPtr source) { mData = vtkPolyDataPtr(); mSource = source; if (mSource) getMapper()->SetInputConnection(mSource->GetOutputPort()); else getMapper()->SetInputConnection(NULL); }
bool DilationFilter::postProcess() { if (!mRawResult) return false; ImagePtr input = this->getCopiedInputImage(); if (!input) return false; QString uid = input->getUid() + "_seg%1"; QString name = input->getName()+" seg%1"; ImagePtr output = createDerivedImage(mServices->patient(), uid, name, mRawResult, input); mRawResult = NULL; if (!output) return false; output->resetTransferFunctions(); mServices->patient()->insertData(output); // set output mOutputTypes.front()->setValue(output->getUid()); // set contour output if (mRawContour!=NULL) { ColorPropertyPtr colorOption = this->getColorOption(mOptions); MeshPtr contour = ContourFilter::postProcess(mServices->patient(), mRawContour, output, colorOption->getValue()); mOutputTypes[1]->setValue(contour->getUid()); mRawContour = vtkPolyDataPtr(); } return true; }