#include <vtkMitkThickSlicesFilter.h>
Public Types | |
enum | { MIP = 0, SUM } |
Public Member Functions | |
vtkTypeRevisionMacro (vtkMitkThickSlicesFilter, vtkThreadedImageAlgorithm) | |
void | PrintSelf (ostream &os, vtkIndent indent) |
vtkSetClampMacro (Dimensionality, int, 2, 3) | |
vtkGetMacro (Dimensionality, int) | |
vtkSetMacro (HandleBoundaries, int) | |
vtkGetMacro (HandleBoundaries, int) | |
vtkBooleanMacro (HandleBoundaries, int) | |
void | SetThickSliceMode (int mode) |
int | GetThickSliceMode () |
Static Public Member Functions | |
static vtkMitkThickSlicesFilter * | New () |
Protected Member Functions | |
vtkMitkThickSlicesFilter () | |
~vtkMitkThickSlicesFilter () | |
virtual int | RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestUpdateExtent (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
void | ThreadedRequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int threadId) |
Protected Attributes | |
int | HandleBoundaries |
int | Dimensionality |
int | m_CurrentMode |
Definition at line 33 of file vtkMitkThickSlicesFilter.h.
anonymous enum |
vtkMitkThickSlicesFilter::vtkMitkThickSlicesFilter | ( | ) | [protected] |
Definition at line 36 of file vtkMitkThickSlicesFilter.cpp.
References Dimensionality, HandleBoundaries, m_CurrentMode, and MIP.
{ this->HandleBoundaries = 1; this->Dimensionality = 2; this->m_CurrentMode = MIP; // by default process active point scalars this->SetInputArrayToProcess(0,0,0,vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS); }
vtkMitkThickSlicesFilter::~vtkMitkThickSlicesFilter | ( | ) | [inline, protected] |
Definition at line 61 of file vtkMitkThickSlicesFilter.h.
{};
int vtkMitkThickSlicesFilter::GetThickSliceMode | ( | ) | [inline] |
Definition at line 98 of file vtkMitkThickSlicesFilter.h.
{ return m_CurrentMode; }
static vtkMitkThickSlicesFilter* vtkMitkThickSlicesFilter::New | ( | ) | [static] |
Referenced by vtkMitkThickSlicesFilterTest().
void vtkMitkThickSlicesFilter::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
Definition at line 49 of file vtkMitkThickSlicesFilter.cpp.
References Dimensionality, and HandleBoundaries.
{ this->Superclass::PrintSelf(os, indent); os << indent << "HandleBoundaries: " << this->HandleBoundaries << "\n"; os << indent << "Dimensionality: " << this->Dimensionality << "\n"; }
int vtkMitkThickSlicesFilter::RequestData | ( | vtkInformation * | request, |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
Definition at line 244 of file vtkMitkThickSlicesFilter.cpp.
{ if (!this->Superclass::RequestData(request, inputVector, outputVector)) { return 0; } vtkImageData* output = vtkImageData::GetData(outputVector); vtkDataArray* outArray = output->GetPointData()->GetScalars(); vtksys_ios::ostringstream newname; newname << (outArray->GetName()?outArray->GetName():"") << "Gradient"; outArray->SetName(newname.str().c_str()); // Why not pass the original array? if (this->GetInputArrayToProcess(0, inputVector)) { output->GetPointData()->AddArray( this->GetInputArrayToProcess(0, inputVector)); } return 1; }
int vtkMitkThickSlicesFilter::RequestInformation | ( | vtkInformation * | , |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
Definition at line 57 of file vtkMitkThickSlicesFilter.cpp.
{ // Get input and output pipeline information. vtkInformation* outInfo = outputVector->GetInformationObject(0); vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); // Get the input whole extent. int extent[6]; inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), extent); // Reduce 3D to 2D output extent[4] = extent[5] = 0; // Store the new whole extent for the output. outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), extent, 6); /* // Set the number of point data componets to the number of // components in the gradient vector. vtkDataObject::SetPointDataActiveScalarInfo(outInfo, VTK_DOUBLE, this->Dimensionality); */ return 1; }
int vtkMitkThickSlicesFilter::RequestUpdateExtent | ( | vtkInformation * | , |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
Definition at line 86 of file vtkMitkThickSlicesFilter.cpp.
{ // Get input and output pipeline information. vtkInformation* outInfo = outputVector->GetInformationObject(0); vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); // Get the input whole extent. int wholeExtent[6]; inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent); // Get the requested update extent from the output. int inUExt[6]; outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), inUExt); /*inUExt[4] -= 5; inUExt[5] += 5; if (inUExt[4] < wholeExtent[4]) */inUExt[4] = wholeExtent[4]; /*if (inUExt[5] > wholeExtent[5]) */inUExt[5] = wholeExtent[5]; // Store the update extent needed from the intput. inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), inUExt, 6); return 1; }
void vtkMitkThickSlicesFilter::SetThickSliceMode | ( | int | mode ) | [inline] |
Definition at line 93 of file vtkMitkThickSlicesFilter.h.
Referenced by mitk::ImageMapperGL2D::GenerateData(), and vtkMitkThickSlicesFilterTest().
{ m_CurrentMode = mode; }
void vtkMitkThickSlicesFilter::ThreadedRequestData | ( | vtkInformation * | , |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | , | ||
vtkImageData *** | inData, | ||
vtkImageData ** | outData, | ||
int | outExt[6], | ||
int | threadId | ||
) | [protected] |
Definition at line 272 of file vtkMitkThickSlicesFilter.cpp.
References vtkMitkThickSlicesFilterExecute().
{ // Get the input and output data objects. vtkImageData* input = inData[0][0]; vtkImageData* output = outData[0]; // The ouptut scalar type must be double to store proper gradients. /* if(output->GetScalarType() != VTK_DOUBLE) { vtkErrorMacro("Execute: output ScalarType is " << output->GetScalarType() << "but must be double."); return; } */ vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector); if (!inputArray) { vtkErrorMacro("No input array was found. Cannot execute"); return; } // Gradient makes sense only with one input component. This is not // a Jacobian filter. if(inputArray->GetNumberOfComponents() != 1) { vtkErrorMacro( "Execute: input has more than one component. " "The input to gradient should be a single component image. " "Think about it. If you insist on using a color image then " "run it though RGBToHSV then ExtractComponents to get the V " "components. That's probably what you want anyhow."); return; } void* inPtr = inputArray->GetVoidPointer(0); void* outPtr = output->GetScalarPointerForExtent(outExt); switch(inputArray->GetDataType()) { vtkTemplateMacro( vtkMitkThickSlicesFilterExecute(this, input, static_cast<VTK_TT*>(inPtr), output, static_cast<VTK_TT*>(outPtr), outExt, threadId) ); default: vtkErrorMacro("Execute: Unknown ScalarType " << input->GetScalarType()); return; } }
vtkMitkThickSlicesFilter::vtkBooleanMacro | ( | HandleBoundaries | , |
int | |||
) |
vtkMitkThickSlicesFilter::vtkGetMacro | ( | Dimensionality | , |
int | |||
) |
vtkMitkThickSlicesFilter::vtkGetMacro | ( | HandleBoundaries | , |
int | |||
) |
vtkMitkThickSlicesFilter::vtkSetClampMacro | ( | Dimensionality | , |
int | , | ||
2 | , | ||
3 | |||
) |
vtkMitkThickSlicesFilter::vtkSetMacro | ( | HandleBoundaries | , |
int | |||
) |
vtkMitkThickSlicesFilter::vtkTypeRevisionMacro | ( | vtkMitkThickSlicesFilter | , |
vtkThreadedImageAlgorithm | |||
) |
int vtkMitkThickSlicesFilter::Dimensionality [protected] |
Definition at line 64 of file vtkMitkThickSlicesFilter.h.
Referenced by PrintSelf(), and vtkMitkThickSlicesFilter().
int vtkMitkThickSlicesFilter::HandleBoundaries [protected] |
Definition at line 61 of file vtkMitkThickSlicesFilter.h.
Referenced by PrintSelf(), and vtkMitkThickSlicesFilter().
int vtkMitkThickSlicesFilter::m_CurrentMode [protected] |
Definition at line 85 of file vtkMitkThickSlicesFilter.h.
Referenced by vtkMitkThickSlicesFilter().