]> Creatis software - clitk.git/blobdiff - common/clitkImageCommon.txx
- display binary image as overlay
[clitk.git] / common / clitkImageCommon.txx
index 547c2c7b94d4f67ba5e3b1587a2547768fbf8f4d..e682593751cafc87e6421963e7e8082e0da4da5b 100644 (file)
 ======================================================================-====*/
 #ifndef CLITKIMAGECOMMON_TXX
 #define CLITKIMAGECOMMON_TXX
-/**
-   -------------------------------------------------
-   * @file   clitkImageCommon.txx
-   * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
-   * @date   07 Sep 2007 11:34:19
-   * 
-   * @brief  
-   * 
-   * 
-   -------------------------------------------------*/
+
 
 //--------------------------------------------------------------------
 template<class PixelType>
@@ -101,9 +92,8 @@ typename itk::Image<PixelType,4>::Pointer NewImage4D(int sx, int sy, int sz, int
 template<class ImageType>
 typename ImageType::Pointer NewImageLike(const typename ImageType::Pointer input, bool allocate) {
   typename ImageType::Pointer output = ImageType::New();
-  output->SetRegions(input->GetLargestPossibleRegion());
-  output->SetOrigin(input->GetOrigin());
-  output->SetSpacing(input->GetSpacing());
+  output->CopyInformation(input);
+  output->SetRegions(input->GetLargestPossibleRegion());  
   if (allocate) output->Allocate();
   return output;
 }