Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
This software is distributed WITHOUT ANY WARRANTY; without even
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ======================================================================-====*/
+ ===========================================================================**/
#ifndef CLITKSEGMENTATIONUTILS_H
#define CLITKSEGMENTATIONUTILS_H
// itk
#include <itkBoundingBox.h>
+#include <itkJoinSeriesImageFilter.h>
/*
According to
//--------------------------------------------------------------------
- //template<class ImageType>
- //typename ImageType::Pointer
- //JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType,
- // ImageType::ImageDimension-1>::Pointer > & slices,
- // const ImageType * input, int dim);
+ template<class ImageType>
+ typename ImageType::Pointer
+ JoinSlices(std::vector<typename itk::Image<typename ImageType::PixelType,
+ ImageType::ImageDimension-1>::Pointer > & slices,
+ const ImageType * input,
+ int direction) {
+ typedef typename itk::Image<typename ImageType::PixelType, ImageType::ImageDimension-1> SliceType;
+ typedef itk::JoinSeriesImageFilter<SliceType, ImageType> JoinSeriesFilterType;
+ typename JoinSeriesFilterType::Pointer joinFilter = JoinSeriesFilterType::New();
+ joinFilter->SetOrigin(input->GetOrigin()[direction]);
+ joinFilter->SetSpacing(input->GetSpacing()[direction]);
+ for(unsigned int i=0; i<slices.size(); i++) {
+ joinFilter->PushBackInput(slices[i]);
+ }
+ joinFilter->Update();
+ return joinFilter->GetOutput();
+ }
//--------------------------------------------------------------------
IsOnTheSameLineSide(PointType C, PointType A, PointType B, PointType like);
//--------------------------------------------------------------------
+
+ //--------------------------------------------------------------------
+ template<class ImageType>
+ void
+ SliceBySliceBuildLineSegmentAccordingToExtremaPosition(const ImageType * input,
+ typename ImageType::PixelType BG,
+ int sliceDimension,
+ int extremaDirection,
+ bool extremaOppositeFlag,
+ int lineDirection,
+ double margin,
+ std::vector<typename ImageType::PointType> & A,
+ std::vector<typename ImageType::PointType> & B);
+ //--------------------------------------------------------------------
+
+
}
#include "clitkSegmentationUtils.txx"