diff --git a/code/io/itk/rttbImageWriter.cpp b/code/io/itk/rttbImageWriter.cpp index 2ce5ca7..a937616 100644 --- a/code/io/itk/rttbImageWriter.cpp +++ b/code/io/itk/rttbImageWriter.cpp @@ -1,57 +1,55 @@ // ----------------------------------------------------------------------- -// MatchPoint - DKFZ translational registration framework +// RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. -// See mapCopyright.txt or -// http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html +// See rttbCopyright.txt or +// http://www.dkfz.de/en/sidt/projects/rttb/copyright.html // // 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. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 793 $ (last changed revision) // @date $Date: 2014-10-10 10:24:45 +0200 (Fr, 10 Okt 2014) $ (last change date) -// @author $Author: hentsch $ (last changed by) -// Subversion HeadURL: $HeadURL: https://svn/sbr/Sources/SBR-Projects/MatchPoint/trunk/Code/IO/include/mapImageReader.h $ +// @author $Author: lzhang $ (last changed by) */ - #include "rttbImageWriter.h" #include "rttbInvalidParameterException.h" namespace rttb { namespace io { namespace itk { ImageWriter::ImageWriter(FileNameString aFileName, ITKImageTypePointer aITKImage) :_fileName(aFileName), _itkImage(aITKImage){ } bool ImageWriter::writeITKFile(){ WriterType::Pointer writer = WriterType::New(); writer->SetFileName(_fileName); writer->SetInput(_itkImage); try{ writer->Update(); } catch( ::itk::ExceptionObject & excp ) { std::cerr << "Error: ITK Exception caught " << excp << std::endl; throw rttb::core::InvalidParameterException("ITK Exception writer->Update()!"); return false; } return true; } }//end namespace itk }//end namespace io }//end namespace rttb diff --git a/code/io/itk/rttbImageWriter.h b/code/io/itk/rttbImageWriter.h index 080824b..f18f7bd 100644 --- a/code/io/itk/rttbImageWriter.h +++ b/code/io/itk/rttbImageWriter.h @@ -1,72 +1,70 @@ // ----------------------------------------------------------------------- -// MatchPoint - DKFZ translational registration framework +// RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. -// See mapCopyright.txt or -// http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html +// See rttbCopyright.txt or +// http://www.dkfz.de/en/sidt/projects/rttb/copyright.html // // 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. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 793 $ (last changed revision) // @date $Date: 2014-10-10 10:24:45 +0200 (Fr, 10 Okt 2014) $ (last change date) -// @author $Author: hentsch $ (last changed by) -// Subversion HeadURL: $HeadURL: https://svn/sbr/Sources/SBR-Projects/MatchPoint/trunk/Code/IO/include/mapImageReader.h $ +// @author $Author: lzhang $ (last changed by) */ - #ifndef __RTTB_IMAGE_WRITER_H #define __RTTB_IMAGE_WRITER_H #include "itkImage.h" #include "itkImageSource.h" #include "itkImageFileWriter.h" #include "rttbBaseType.h" #include "rttbITKImageMaskAccessor.h" namespace rttb { namespace io { namespace itk { /** @class ImageWriter * @brief Helper class writing 2D/3D images to file ... * */ class ImageWriter { typedef ::itk::Image ITKMaskImageType; typedef ITKMaskImageType::Pointer ITKImageTypePointer; typedef ::itk::ImageFileWriter WriterType; private: FileNameString _fileName; ITKImageTypePointer _itkImage; public: ImageWriter(FileNameString aFileName, ITKImageTypePointer aITKImage); /*! @brief Write itk image to file @return Return true if successful. @exception InvalidParameterException thrown if itk exception by writing the image */ bool writeITKFile(); }; }//end namespace itk }//end namespace io }//end namespace rttb #endif