diff --git a/Core/Code/Algorithms/mitkOverwriteSliceFilter.cpp b/Core/Code/Algorithms/mitkOverwriteSliceFilter.cpp index 886ff7e8bb..dfb0663321 100644 --- a/Core/Code/Algorithms/mitkOverwriteSliceFilter.cpp +++ b/Core/Code/Algorithms/mitkOverwriteSliceFilter.cpp @@ -1,50 +1,55 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html 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. =========================================================================*/ #include "mitkOverwriteSliceFilter.h" mitk::OverwriteSliceFilter::OverwriteSliceFilter(){ m_Map = vtkSmartPointer::New(); m_TimeStep = 0; } mitk::OverwriteSliceFilter::~OverwriteSliceFilter(){ m_Map = NULL; m_Slice = NULL; } void mitk::OverwriteSliceFilter::SetInputMap(mitk::Image* map){ this->m_Map = map->GetVtkImageData(this->m_TimeStep); } +void mitk::OverwriteSliceFilter::SetInputSlice(mitk::Image* slice){ + this->m_Slice = slice->GetVtkImageData(this->m_TimeStep); +} + void mitk::OverwriteSliceFilter::GenerateInputRequestedRegion(){ //As we want all pixel information fo the image in our plane, the requested region //is set to the largest possible region in the image. //This is needed because an oblique plane has a larger extent then the image //and the in pipeline it is checked via PropagateResquestedRegion(). But the //extent of the slice is actually fitting because it is oblique within the image. ImageToImageFilter::InputImagePointer input = const_cast< ImageToImageFilter::InputImageType* > ( this->GetInput() ); input->SetRequestedRegionToLargestPossibleRegion(); } void mitk::OverwriteSliceFilter::GenerateData() { + //this->SetOutput( const_cast(GetInput()) ); } \ No newline at end of file diff --git a/Core/Code/Algorithms/mitkOverwriteSliceFilter.h b/Core/Code/Algorithms/mitkOverwriteSliceFilter.h index 87f2ebb960..334c85ea61 100644 --- a/Core/Code/Algorithms/mitkOverwriteSliceFilter.h +++ b/Core/Code/Algorithms/mitkOverwriteSliceFilter.h @@ -1,66 +1,67 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html 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 mitkOverwriteSliceFilter_h_Included #define mitkOverwriteSliceFilter_h_Included #include "MitkExports.h" #include "mitkImageToImageFilter.h" #include #include namespace mitk { class MITK_CORE_EXPORT OverwriteSliceFilter : public ImageToImageFilter { public: mitkClassMacro(OverwriteSliceFilter, ImageToImageFilter); itkNewMacro(OverwriteSliceFilter); /** \brief Set the time step in the 4D volume */ void SetTimeStep( unsigned int timestep){ this->m_TimeStep = timestep; } unsigned int GetTimeStep(){ return this->m_TimeStep; } - void SetInputSlice(mitk::Image* slice){ this->m_Slice = slice; } + void SetInputSlice(vtkImageData* slice){ this->m_Slice = slice; } + void SetInputSlice(mitk::Image* slice); void SetInputMap(vtkImageData* map){ this->m_Map = map; } void SetInputMap(mitk::Image* map); protected: OverwriteSliceFilter(); virtual ~OverwriteSliceFilter(); virtual void GenerateData(); virtual void GenerateInputRequestedRegion(); - mitk::Image* m_Slice; + vtkSmartPointer m_Slice; vtkSmartPointer m_Map; unsigned int m_TimeStep; }; } #endif // mitkOverwriteSliceFilter_h_Included \ No newline at end of file