1 /*=========================================================================
4 Module: $RCSfile: bbvtkMIPCreator.cxx,v $
6 Date: $Date: 2008/04/18 12:59:52 $
7 Version: $Revision: 1.2 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
28 #include "bbvtkMIPCreator.h"
29 #include "bbvtkPackage.h"
35 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MIPCreator)
36 BBTK_BLACK_BOX_IMPLEMENTATION(MIPCreator,bbtk::AtomicBlackBox);
42 void MIPCreator::bbUserConstructor()
48 void MIPCreator::bbUserCopyConstructor()
53 void MIPCreator::Init()
56 // Create the pipeline
57 mCast = vtkImageShiftScale::New();
58 mCast->SetOutputScalarTypeToUnsignedChar();
59 mCast->ClampOverflowOn();
61 mMIP = vtkVolumeRayCastMIPFunction::New();
62 mMIP->SetMaximizeMethodToScalarValue();
64 mMapper = vtkVolumeRayCastMapper::New();
65 mMapper->SetVolumeRayCastFunction(mMIP);
66 mMapper->SetInput(mCast->GetOutput()); // (smoother.GetOutput())
68 mVolume = vtkVolume::New();
69 mVolume->SetMapper(mMapper);
71 // mMapper->ScalarVisibilityOff();
72 // mMapper->ImmediateModeRenderingOn();
74 bbSetOutputOut(mVolume);
77 //---------------------------------------------------------------------
79 void MIPCreator::Process()
81 mCast->SetInput( bbGetInputIn() );
82 mCast->SetScale( bbGetInputScale() / 100. );
83 mCast->SetShift( -bbGetInputShift() );
87 // mVolume->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] );
88 // mVolume->GetProperty()->SetOpacity( bbGetInputOpacity() );