/*========================================================================= Program: GIFT Sample Activity Feature Generator Module: giftSampleActivity.cxx Language: C++ Date: 2005/11/22 Version: 0.1 Author: Dan Mueller [d.mueller@qut.edu.au] Copyright (c) 2005 Queensland University of Technology. All rights reserved. See giftCopyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __giftSampleActivity_CXX #define __giftSampleActivity_CXX //GIFT Includes #include "giftSampleActivity.h" //ITK includes #include "itkImage.h" #include "itkImageFileWriter.h" #include "itkRescaleIntensityImageFilter.h" namespace gift { ///////////////////////////////////////////////////////// //Constructor() template SampleActivity ::SampleActivity() { } ///////////////////////////////////////////////////////// //PrintSelf() template void SampleActivity ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); } ///////////////////////////////////////////////////////// //GenerateData() template void SampleActivity ::GenerateData() { //Get number of input and output images unsigned int numberOfInputs = this->GetNumberOfRequiredInputs(); unsigned int numberOfOutputs = this->GetNumberOfRequiredOutputs(); //Allocate memory for outputs for (unsigned int idx = 0; idx < numberOfOutputs; idx++) { OutputImagePointer outputPtr = this->GetOutput(idx); outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); outputPtr->Allocate(); } //Graft outputs for (unsigned int index=0; indexitk::ProcessObject::GetInput(index); itk::ImageToImageFilter::OutputImageType* outputToGraft = dynamic_cast::OutputImageType*>(ptrOutputToGraft); this->GraftNthOutput(index, outputToGraft); } } }// end namespace gift #endif