[vtkusers] ADC MAP Pipeline
Ale
notinmyhead at gmail.com
Tue Jul 3 09:21:31 EDT 2012
Hello,
I'm trying to set up a ADC MAP Pipeline, so I wrote the following code (where vtkVolumes is defined as std::vector< vtkImageData *>):
vtkSmartPointer< vtkImageMathematics> logB, divideLog, divideFactor;
vtkImageData * tmpImage;
/* divideLog = IMG_B0 / IMG_BX */
divideLog = vtkSmartPointer<vtkImageMathematics >::New();
divideLog->SetInput1(this->vtkVolumes[1]);
divideLog->SetInput2(this->vtkVolumes[0]);
divideLog->SetOperationToDivide();
divideLog->Update();
/* logB = log (divideLog) */
logB = vtkSmartPointer<vtkImageMathematics >::New();
logB->SetInput(divideLog->GetOutput());
logB->SetOperationToLog();
logB->Update();
/* divideFactor = logB / factor */
divideFactor = vtkSmartPointer< vtkImageMathematics >::New();
divideFactor->SetInput(logB->GetOutput());
divideFactor->SetConstantK(1.0/(double) factor);
divideFactor->SetOperationToMultiplyByK();
divideFactor->Update();
tmpImage = vtkImageData::New();
tmpImage->DeepCopy(divideFactor->GetOutput());
tmpImage->Update();
/* Deleting previous volumes */
this->vtkVolumes.clear();
this->vtkVolumes.resize(1);
this->vtkVolumes[0] = tmpImage;
Problem are:
1. it seems to work but the volume, once visualized is "empty"
2. why is not working at all if I place the last filter output directly into the vtkVolumes[0]?
3. even if it'll work, how to move it to a RBG map?
Thanks,
More information about the vtkusers
mailing list