]> Creatis software - clitk.git/commitdiff
Removed clitkMakeSphereImage because it is available in RTK and we don't
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 7 Jun 2013 09:26:20 +0000 (11:26 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 7 Jun 2013 09:26:20 +0000 (11:26 +0200)
want to support several tools doing the same thing

tools/CMakeLists.txt
tools/clitkMakeSphereImage.cxx [deleted file]

index 5077acc9524b38db636c2f8df3a000ff1b4b27c8..d35761142fe0f597e37cac1a668184bb20c185e7 100644 (file)
@@ -239,10 +239,6 @@ IF (CLITK_BUILD_TOOLS)
   TARGET_LINK_LIBRARIES(clitkMaskLandmarks clitkCommon)
   SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMaskLandmarks)
 
-  ADD_EXECUTABLE(clitkMakeSphereImage clitkMakeSphereImage.cxx) # clitkLineProfileGenericFilter.cxx ${clitkLineProfile_GGO_C})
-  TARGET_LINK_LIBRARIES(clitkMakeSphereImage clitkCommon)
-  SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMakeSphereImage)
-
   WRAP_GGO(clitkJacobianImage_GGO_C clitkJacobianImage.ggo)
   ADD_EXECUTABLE(clitkJacobianImage clitkJacobianImage.cxx clitkJacobianImageGenericFilter.cxx ${clitkJacobianImage_GGO_C})
   TARGET_LINK_LIBRARIES(clitkJacobianImage clitkCommon)
diff --git a/tools/clitkMakeSphereImage.cxx b/tools/clitkMakeSphereImage.cxx
deleted file mode 100644 (file)
index 7f29dfe..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "itkImage.h"
-#include "itkSphereSpatialFunction.h"
-#include <itkImageRegionIterator.h>
-#include "itkImageFileWriter.h"
-
-int main(int argc, char** argv) {
-  
-  const unsigned int dim = 3;
-  typedef char PixelType;
-  typedef itk::Image<PixelType, dim> ImageType;
-  typedef ImageType::IndexType IndexType;
-  typedef ImageType::PointType PointType;
-  typedef ImageType::SizeType SizeType;
-  typedef ImageType::RegionType RegionType;
-
-  IndexType index;
-  index.Fill(0);
-
-  SizeType size;
-  size[0] = atoi(argv[2]);
-  size[1] = atoi(argv[3]);
-  size[2] = atoi(argv[4]);
-  
-  PointType origin;
-  origin[0] = atoi(argv[5]);
-  origin[1] = atoi(argv[6]);
-  origin[2] = atoi(argv[7]);
-  
-  RegionType region;
-  region.SetIndex(index);
-  region.SetSize(size);
-
-  ImageType::Pointer image = ImageType::New();
-  image->SetRegions(region);
-  image->Allocate();
-  
-  typedef itk::SphereSpatialFunction<dim, PointType> ShpereFunctionType;
-  ShpereFunctionType::Pointer sphere = ShpereFunctionType::New();
-  
-  double radius = atof(argv[8])/2;
-  sphere->SetCenter(origin);
-  sphere->SetRadius(radius);
-  
-  PixelType max = itk::NumericTraits<PixelType>::max();
-  typedef itk::ImageRegionIterator<ImageType> ImageIteratorType;
-  ImageIteratorType it(image, region);
-  PointType point;
-  for (it.GoToBegin(); !it.IsAtEnd(); ++it) {
-    image->TransformIndexToPhysicalPoint(it.GetIndex(), point);
-    if (sphere->Evaluate(point)) {
-      PixelType value = static_cast<PixelType>(max*(point - origin).GetNorm()/radius); 
-      it.Set(value);
-    }
-    else
-      it.Set(0);
-  }
-  
-  typedef itk::ImageFileWriter<ImageType> ImageWriterType;
-  ImageWriterType::Pointer writer = ImageWriterType::New();
-  writer->SetInput(image);
-  writer->SetFileName(argv[1]);
-  writer->Update();
-}
\ No newline at end of file