Verified Commit e85175ac authored by Flavien BRIDAULT-LOUCHEZ's avatar Flavien BRIDAULT-LOUCHEZ
Browse files

fix(build): correct build after merge

parent e0451915
Pipeline #155224 failed with stages
......@@ -20,31 +20,31 @@
*
***********************************************************************/
#include "imageFilterOp/BresenhamLine.hpp"
#include "filter/image/BresenhamLine.hpp"
#include <cmath>
namespace imageFilterOp
namespace sight::filter::image
{
//------------------------------------------------------------------------------
BresenhamLine::PathType BresenhamLine::draw(const ::fwDataTools::helper::MedicalImage::Orientation orientation,
BresenhamLine::PathType BresenhamLine::draw(const data::tools::helper::MedicalImage::Orientation orientation,
const CoordinatesType& startCoord, const CoordinatesType& endCoord)
{
size_t dim0 = 0, dim1 = 1;
switch(orientation)
{
case ::fwDataTools::helper::MedicalImage::X_AXIS:
case data::tools::helper::MedicalImage::X_AXIS:
dim0 = 1;
dim1 = 2;
break;
case ::fwDataTools::helper::MedicalImage::Y_AXIS:
case data::tools::helper::MedicalImage::Y_AXIS:
dim0 = 0;
dim1 = 2;
break;
case ::fwDataTools::helper::MedicalImage::Z_AXIS:
case data::tools::helper::MedicalImage::Z_AXIS:
dim0 = 0;
dim1 = 1;
break;
......@@ -98,4 +98,4 @@ BresenhamLine::PathType BresenhamLine::draw(const ::fwDataTools::helper::Medical
return result;
}
} // namespace imageFilterOp
} // namespace sight::filter::image
......@@ -22,33 +22,32 @@
#pragma once
#include "imageFilterOp//config.hpp"
#include "filter/image//config.hpp"
#include <fwData/Image.hpp>
#include <data/Image.hpp>
#include <data/tools/helper/MedicalImage.hpp>
#include <fwDataTools/helper/MedicalImage.hpp>
namespace imageFilterOp
namespace sight::filter::image
{
/**
* @brief Static class to compute Bresenham lines in 3D images.
*
*/
class IMAGEFILTEROP_CLASS_API BresenhamLine
class FILTER_IMAGE_CLASS_API BresenhamLine
{
public:
/// Voxel coordinate type.
typedef std::array< ::fwData::Image::IndexType, 3 > CoordinatesType;
typedef std::array< data::Image::IndexType, 3 > CoordinatesType;
/// Series of coordinates making up a line.
typedef std::vector< CoordinatesType > PathType;
/// Computes a Bresenham line in a 3D image slice.
IMAGEFILTEROP_API static PathType draw(const ::fwDataTools::helper::MedicalImage::Orientation orientation,
const CoordinatesType& startCoord, const CoordinatesType& endCoord);
FILTER_IMAGE_API static PathType draw(const data::tools::helper::MedicalImage::Orientation orientation,
const CoordinatesType& startCoord, const CoordinatesType& endCoord);
};
......
......@@ -20,18 +20,18 @@
*
***********************************************************************/
#include "imageFilterOp/Flipper.hpp"
#include "filter/image/Flipper.hpp"
#include <core/tools/Dispatcher.hpp>
#include <core/tools/TypeKeyTypeMapping.hpp>
#include <data/tools/fieldHelper/MedicalImageHelpers.hpp>
#include <fwItkIO/itk.hpp>
#include <io/itk/itk.hpp>
#include <itkFlipImageFilter.h>
namespace imageFilterOp
namespace sight::filter::image
{
struct Parameters
......@@ -51,7 +51,7 @@ struct Flipping
void operator()(Parameters& params)
{
typedef typename ::itk::Image< PixelType, dimension> ImageType;
const typename ImageType::Pointer itkImage = ::fwItkIO::itkImageFactory< ImageType >(params.i_image);
const typename ImageType::Pointer itkImage = io::itk::itkImageFactory< ImageType >(params.i_image);
typename ::itk::FlipImageFilter<ImageType>::Pointer flipFilter =
::itk::FlipImageFilter<ImageType>::New();
......@@ -67,7 +67,7 @@ struct Flipping
flipFilter->Update();
typename ImageType::Pointer outputImage = flipFilter->GetOutput();
::fwItkIO::itkImageToFwDataImage(outputImage, params.o_image);
io::itk::itkImageToFwDataImage(outputImage, params.o_image);
}
};
......@@ -129,4 +129,4 @@ void Flipper::flip(const data::Image::csptr& _inImage,
//-----------------------------------------------------------------------------
}// namespace imageFilterOp
}// namespace sight::filter::image
......@@ -22,17 +22,17 @@
#pragma once
#include "imageFilterOp/config.hpp"
#include "filter/image/config.hpp"
#include <data/Image.hpp>
#include <data/TransformationMatrix3D.hpp>
namespace imageFilterOp
namespace sight::filter::image
{
/**
* @brief The Flipper class
*/
class IMAGEFILTEROP_CLASS_API Flipper
class FILTER_IMAGE_CLASS_API Flipper
{
public:
......@@ -43,10 +43,10 @@ public:
* @param _outImage flipped image.
* @param _flipAxis axes on which to flip the image.
*/
static IMAGEFILTEROP_API void flip(const data::Image::csptr& _inImage,
const data::Image::sptr& _outImage,
const std::array<bool, 3>& _flipAxis);
static FILTER_IMAGE_API void flip(const data::Image::csptr& _inImage,
const data::Image::sptr& _outImage,
const std::array<bool, 3>& _flipAxis);
};
}// namespace imageFilterOp
}// namespace sight::filter::image
......@@ -20,13 +20,13 @@
*
***********************************************************************/
#include "data/tools/Image.hpp"
#include "Image.hpp"
#include <core/tools/Combinatory.hpp>
#include <core/tools/Dispatcher.hpp>
#include <core/tools/TypeKeyTypeMapping.hpp>
namespace sight::data::tools
namespace sight::filter::image
{
//------------------------------------------------------------------------------
......@@ -88,7 +88,7 @@ struct RoiApplyerCaller
//------------------------------------------------------------------------------
void Image::applyRoi( data::Image::sptr image, data::Image::sptr roi )
void applyRoi( data::Image::sptr image, data::Image::sptr roi )
{
SLM_ASSERT( "Null image pointers", image && roi);
SLM_ASSERT( "Images have different size", image->getSize2() == roi->getSize2());
......@@ -167,7 +167,7 @@ struct RoiTesterCaller
//------------------------------------------------------------------------------
bool Image::isRoiApplyed( data::Image::sptr image, data::Image::sptr roi, data::Image::sptr imgRoiApplyed )
bool isRoiApplyed( data::Image::sptr image, data::Image::sptr roi, data::Image::sptr imgRoiApplyed )
{
SLM_ASSERT( "Null image pointers", image && imgRoiApplyed && roi);
SLM_ASSERT( "Images have different size",
......@@ -187,4 +187,4 @@ bool Image::isRoiApplyed( data::Image::sptr image, data::Image::sptr roi, data::
//------------------------------------------------------------------------------
} // namespace sight::data::tools
} // namespace sight::filter::image
......@@ -22,7 +22,7 @@
#pragma once
#include "data/config.hpp"
#include "filter/image/config.hpp"
#include <core/base.hpp>
#include <core/tools/Type.hpp>
......@@ -31,45 +31,30 @@
#include <geometry/data/Compare.hpp>
namespace sight::data::tools
// Contains helper to generate and compare images.
namespace sight::filter::image
{
/**
* @brief This class contains helper to generate and compare images.
* @brief Apply roi to image
*
* set input image voxel to zero where roi voxel value is zero
*/
class Image
{
public:
/**
* @brief Apply roi to image
*
* set input image voxel to zero where roi voxel value is zero
*/
DATA_API static void applyRoi( data::Image::sptr image,
data::Image::sptr roi );
/**
* @brief Check if 'imgRoiApplyed' is the result of 'roi' applyed to 'image'
*
*/
DATA_API static bool isRoiApplyed( data::Image::sptr image,
data::Image::sptr imgRoiApplyed,
data::Image::sptr roi );
/**
* @brief Merge mask in image imgDest: put value 'val' in imgDest when mask value != 0
*/
template<typename IMG_DEST_TYPE, typename MASK_TYPE>
void mergeMask(const data::Image::sptr& imgDest, const data::Image::csptr& mask, IMG_DEST_TYPE val );
FILTER_IMAGE_API static void applyRoi( data::Image::sptr image, data::Image::sptr roi );
};
//------------------------------------------------------------------------------
/**
* @brief Check if 'imgRoiApplyed' is the result of 'roi' applyed to 'image'
*
*/
FILTER_IMAGE_API static bool isRoiApplyed( data::Image::sptr image,
data::Image::sptr imgRoiApplyed,
data::Image::sptr roi );
/**
* @brief Merge mask in image imgDest: put value 'val' in imgDest when mask value != 0
*/
template<typename IMG_DEST_TYPE, typename MASK_TYPE>
void Image::mergeMask(const data::Image::sptr& imgDest, const data::Image::csptr& mask, IMG_DEST_TYPE val )
void mergeMask(const data::Image::sptr& imgDest, const data::Image::csptr& mask, IMG_DEST_TYPE val )
{
typedef IMG_DEST_TYPE ImgDestType;
typedef MASK_TYPE MaskType;
......@@ -100,4 +85,4 @@ void Image::mergeMask(const data::Image::sptr& imgDest, const data::Image::csptr
}
}
} // namespace sight::data::tools
} // namespace sight::filter::image
......@@ -20,9 +20,9 @@
*
***********************************************************************/
#include "data/tools/ImageDiff.hpp"
#include "ImageDiff.hpp"
namespace sight::data::tools
namespace sight::filter::image
{
//-----------------------------------------------------------------------------
......@@ -248,4 +248,4 @@ void ImageDiff::revertDiffElt(const data::Image::sptr& img, size_t eltIndex) con
img->setPixelBuffer(index, oldValue);
}
} // namespace sight::data::tools
} // namespace sight::filter::image
......@@ -22,17 +22,17 @@
#pragma once
#include "data/config.hpp"
#include "filter/image/config.hpp"
#include <data/Image.hpp>
namespace sight::data::tools
namespace sight::filter::image
{
/**
* @brief Class memorizing pixel changes in an image.
*/
class DATA_CLASS_API ImageDiff
class FILTER_IMAGE_CLASS_API ImageDiff
{
public:
......@@ -44,50 +44,50 @@ public:
};
/// Constructor.
DATA_API ImageDiff(const size_t imageElementSize = 0, const size_t reservedElements = 0);
FILTER_IMAGE_API ImageDiff(const size_t imageElementSize = 0, const size_t reservedElements = 0);
/// Destructor
DATA_API ~ImageDiff();
FILTER_IMAGE_API ~ImageDiff();
/// Copy constructor
DATA_API ImageDiff(const ImageDiff& other);
FILTER_IMAGE_API ImageDiff(const ImageDiff& other);
/// Move constructor
DATA_API ImageDiff(ImageDiff&& other);
FILTER_IMAGE_API ImageDiff(ImageDiff&& other);
/// Copy assignement.
DATA_API ImageDiff& operator= (const ImageDiff& other);
FILTER_IMAGE_API ImageDiff& operator= (const ImageDiff& other);
/// Move assignement.
DATA_API ImageDiff& operator= (ImageDiff&& other);
FILTER_IMAGE_API ImageDiff& operator= (ImageDiff&& other);
/// Concatenate two diffs.
DATA_API void addDiff(const ImageDiff& diff);
FILTER_IMAGE_API void addDiff(const ImageDiff& diff);
/// Append a new pixel diff.
DATA_API void addDiff(const data::Image::IndexType index, const data::Image::BufferType* oldValue,
const data::Image::BufferType* newValue);
FILTER_IMAGE_API void addDiff(const data::Image::IndexType index, const data::Image::BufferType* oldValue,
const data::Image::BufferType* newValue);
/// Write the new values in the image.
DATA_API void applyDiff(const data::Image::sptr& img) const;
FILTER_IMAGE_API void applyDiff(const data::Image::sptr& img) const;
/// Write the old value back in the image.
DATA_API void revertDiff(const data::Image::sptr& img) const;
FILTER_IMAGE_API void revertDiff(const data::Image::sptr& img) const;
/// Return the amount of memory actually used by the elements.
DATA_API size_t getSize() const;
FILTER_IMAGE_API size_t getSize() const;
/// Returns the number of stored pixel diffs.
DATA_API size_t getNumberOfElements() const;
FILTER_IMAGE_API size_t getNumberOfElements() const;
/// Set the number of elements to 0.
DATA_API void clear();
FILTER_IMAGE_API void clear();
/// Reallocate the buffer to fit the actual size of the container.
DATA_API void shrink();
FILTER_IMAGE_API void shrink();
/// Returns the element at the given index
DATA_API ElementType getElement(size_t index) const;
FILTER_IMAGE_API ElementType getElement(size_t index) const;
/// Returns the image index from the element at the given index
inline data::Image::IndexType getElementDiffIndex(size_t eltIndex) const;
......@@ -124,4 +124,4 @@ data::Image::IndexType ImageDiff::getElementDiffIndex(size_t eltIndex) const
return *reinterpret_cast< data::Image::IndexType* >(eltPtr);
}
} // namespace sight::data::tools
} // namespace sight::filter::image
......@@ -20,7 +20,7 @@
*
***********************************************************************/
#include "imageFilterOp/ImageExtruder.hpp"
#include "filter/image/ImageExtruder.hpp"
#include <core/tools/Dispatcher.hpp>
#include <core/tools/TypeKeyTypeMapping.hpp>
......@@ -28,7 +28,7 @@
#include <glm/gtx/intersect.hpp>
#include <glm/vec2.hpp>
namespace imageFilterOp
namespace sight::filter::image
{
//------------------------------------------------------------------------------
......
......@@ -22,14 +22,14 @@
#pragma once
#include "imageFilterOp/config.hpp"
#include "filter/image/config.hpp"
#include <data/Image.hpp>
#include <data/Mesh.hpp>
#include <glm/vec3.hpp>
namespace imageFilterOp
namespace sight::filter::image
{
/**
......@@ -46,7 +46,7 @@ namespace imageFilterOp
* @pre Input meshes must have cells with 3 or 4 points.
* @warning The image and meshes must be used without transformation matrices in 3D scene, no matrices are used here.
*/
class IMAGEFILTEROP_CLASS_API ImageExtruder final
class FILTER_IMAGE_CLASS_API ImageExtruder final
{
public:
......@@ -59,7 +59,7 @@ public:
* @warning No data are locked here, it must be done before.
* @warning No signals are sent here, it must be done after.
*/
static IMAGEFILTEROP_API void extrude(const data::Image::sptr& _image, const data::Mesh::csptr& _mesh);
static FILTER_IMAGE_API void extrude(const data::Image::sptr& _image, const data::Mesh::csptr& _mesh);
/**
* @brief Stores parameters of the functor.
......@@ -90,4 +90,4 @@ private:
};
}// namespace imageFilterOp
}// namespace sight::filter::image
......@@ -20,28 +20,26 @@
*
***********************************************************************/
#include "imageFilterOp/Labeling.hpp"
#include "filter/image/Labeling.hpp"
#include "imageFilterOp/filters.hpp"
#include "imageFilterOp/filters.hxx"
#include "filter/image/filters.hpp"
#include "filter/image/filters.hxx"
#include <fwCom/Signal.hpp>
#include <fwCom/Signal.hxx>
#include <fwCom/Signals.hpp>
#include <core/com/Signal.hpp>
#include <core/com/Signal.hxx>
#include <core/com/Signals.hpp>
#include <core/tools/Dispatcher.hpp>
#include <core/tools/TypeKeyTypeMapping.hpp>
#include <fwData/Boolean.hpp>
#include <fwData/Image.hpp>
#include <fwData/String.hpp>
#include <fwDataTools/fieldHelper/Image.hpp>
#include <fwDataTools/fieldHelper/MedicalImageHelpers.hpp>
#include <fwTools/Dispatcher.hpp>
#include <fwTools/TypeKeyTypeMapping.hpp>
#include <data/Boolean.hpp>
#include <data/Image.hpp>
#include <data/String.hpp>
#include <data/tools/fieldHelper/Image.hpp>
#include <data/tools/fieldHelper/MedicalImageHelpers.hpp>
#include <itkLabelImageToShapeLabelMapFilter.h>
namespace imageFilterOp
namespace sight::filter::image
{
//------------------------------------------------------------------------------
......@@ -50,8 +48,8 @@ struct LabelingFilter
{
struct Parameters
{
::fwData::Image::sptr m_inputImage;
::fwData::Image::sptr m_outputImage;
data::Image::sptr m_inputImage;
data::Image::sptr m_outputImage;
unsigned int m_numLabels;
};
......@@ -63,32 +61,32 @@ struct LabelingFilter
typedef itk::Image< PIXELTYPE, 3 > ImageType;
typedef itk::Image< std::uint8_t, 3 > BinaryImageType;
typename ImageType::Pointer itkImage;
itkImage = ::fwItkIO::itkImageFactory< ImageType >(params.m_inputImage);
itkImage = io::itk::itkImageFactory< ImageType >(params.m_inputImage);
BinaryImageType::Pointer out;
out = ::imageFilterOp::labeling<PIXELTYPE, 3>(itkImage, params.m_numLabels);
out = filter::image::labeling<PIXELTYPE, 3>(itkImage, params.m_numLabels);
::fwItkIO::dataImageFactory< BinaryImageType >(out, params.m_outputImage);
io::itk::dataImageFactory< BinaryImageType >(out, params.m_outputImage);
}
};
//------------------------------------------------------------------------------
::fwData::Image::sptr labeling(::fwData::Image::sptr image, unsigned int numLabels)
data::Image::sptr labeling(data::Image::sptr image, unsigned int numLabels)
{
::fwData::Image::sptr outputImage = ::fwData::Image::New();
data::Image::sptr outputImage = data::Image::New();
LabelingFilter::Parameters params;
params.m_inputImage = image;
params.m_outputImage = outputImage;
params.m_numLabels = numLabels;
const ::fwTools::Type type = image->getType();
::fwTools::Dispatcher< ::fwTools::SupportedDispatcherTypes, LabelingFilter >::invoke( type, params );
const core::tools::Type type = image->getType();
core::tools::Dispatcher< core::tools::SupportedDispatcherTypes, LabelingFilter >::invoke( type, params );
// Notify image
::fwData::Object::ModifiedSignalType::sptr sig;
sig = outputImage->signal< ::fwData::Object::ModifiedSignalType >(::fwData::Object::s_MODIFIED_SIG);
data::Object::ModifiedSignalType::sptr sig;
sig = outputImage->signal< data::Object::ModifiedSignalType >(data::Object::s_MODIFIED_SIG);
sig->asyncEmit();
return outputImage;
......@@ -101,8 +99,8 @@ struct LabelImageFilter
{
struct Parameters
{
::fwData::Image::sptr i_image;
std::vector< ::fwData::PointList::sptr > i_lPointListCentroids;
data::Image::sptr i_image;
std::vector< data::PointList::sptr > i_lPointListCentroids;
std::vector< std::vector<size_t> > i_lPointListLabels;
};
//------------------------------------------------------------------------------
......@@ -110,11 +108,11 @@ struct LabelImageFilter
template<class PIXELTYPE>
void operator()(Parameters& params)
{
::fwData::Image::sptr image = params.i_image;
data::Image::sptr image = params.i_image;
const unsigned int dimension = 3;
SLM_ASSERT("Only image dimension 3 managed.", image->getNumberOfDimensions() == dimension);
typedef typename ::itk::Image<PIXELTYPE, dimension> InputImageType;
typename InputImageType::Pointer itkInputImage = ::fwItkIO::itkImageFactory<InputImageType>( image );
typename InputImageType::Pointer itkInputImage = io::itk::itkImageFactory<InputImageType>( image );
typedef PIXELTYPE LabelType;
typedef ::itk::Image< LabelType, dimension > OutputImageType;
......@@ -134,7 +132,7 @@ struct LabelImageFilter
if(!params.i_lPointListCentroids.empty() && !params.i_lPointListLabels.empty())
{
LabelMapType* labelMap = i2l->GetOutput();
::fwData::Point::sptr newPoint;
data::Point::sptr newPoint;