/*========================================================================= Program: GIFT Absolute Sample Activity Feature Generator Module: giftAbsSampleActivitye.h Language: C++ Date: 2005/11/26 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 __giftAbsSampleActivity_CXX #define __giftAbsSampleActivity_CXX //GIFT Includes #include "giftAbsSampleActivity.h" //ITK includes #include "itkImage.h" #include "itkAbsImageFilter.h" #include "itkImageFileWriter.h" #include "itkRescaleIntensityImageFilter.h" namespace gift { ///////////////////////////////////////////////////////// //Constructor() template AbsSampleActivity ::AbsSampleActivity() { } ///////////////////////////////////////////////////////// //PrintSelf() template void AbsSampleActivity ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); } ///////////////////////////////////////////////////////// //GenerateData() template void AbsSampleActivity ::GenerateData() { //Get number of input and output images unsigned int numberOfInputs = this->GetNumberOfRequiredInputs(); unsigned int numberOfOutputs = this->GetNumberOfRequiredOutputs(); //Foreach output for (unsigned int index = 0; index < numberOfOutputs; index++) { //Allocate pointer OutputImagePointer outputPtr = this->GetOutput(index); outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); outputPtr->Allocate(); //Attach input to AbsImageFilter typedef itk::AbsImageFilter AbsFilterType; AbsFilterType::Pointer filterAbs = AbsFilterType::New(); filterAbs->SetInput(this->GetInput(index)); filterAbs->Update(); //Graft to output this->GraftNthOutput(index, filterAbs->GetOutput()); } } }// end namespace gift #endif