Commit 56bab3e2 authored by Julien WAECHTER's avatar Julien WAECHTER 🐿
Browse files

Updated fwItkIO and ioITK

Activated ioITK in VRRender

--HG--
branch : fw4spl_0.10.0
parent 9d3ff4e7
TYPE = 'bundle'
VERSION = '0-1'
USE = ['boost','itkCommon']
USE = ['boost','itk4Common']
LIB = [
'fwTools_0-1',
'fwRuntime_0-3',
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -15,8 +15,6 @@ namespace ioITK
/**
* @brief This class is started when the bundles is loaded.
* @class Plugin
*
* @date 2009-2011
*/
struct Plugin : public ::fwRuntime::Plugin
{
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -7,7 +7,7 @@
#include <fwRuntime/utils/GenericExecutableFactoryRegistrar.hpp>
#include <fwServices/macros.hpp>
#include <inr2itk/itkInrImageIO.h>
#include <inr2itk/itkInrImageIO.hpp>
#include "ioITK/Plugin.hpp"
......
......@@ -3,16 +3,22 @@ CLASSTEST=[
]
USE = ['boost']
LIB = ['fwData_0-1',
LIB = [
'fwData_0-1',
'fwTools_0-1',
'fwCore_0-1',
'fwDataTools_0-1',
'fwTest_0-1',
'fwItkIO_0-1',]
'fwItkIO_0-1',
]
BUNDLES = []
REQUIREMENTS = ['ioITK_0-1']
REQUIREMENTS = [
'dataReg_0-1',
'servicesReg_0-1',
'gui_0-1',
'ioITK_0-1',
]
CONSOLE = 'yes'
LOGLEVEL='trace'
<profile name="IoMfoTest" version="0.1">
<profile name="ioITKTest" version="0.1">
<activate id="dataReg" version="0-1" />
<activate id="servicesReg" version="0-1" />
<activate id="gui" version="0-1" />
<activate id="guiQt" version="0-1" />
<activate id="io" version="0-1" />
<activate id="ioITK" version="0-1" />
......
......@@ -4,8 +4,8 @@ VERSION = '0-1'
USE = [
'boost',
'boostFilesystem',
'itkIO',
'gdcmMSFF'
'boostThread',
'itk4IOImageBase',
'itk4IOJPEG',
]
......@@ -4,7 +4,7 @@
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include "itkObjectFactoryBase.h"
#include <itkObjectFactoryBase.h>
......
......@@ -7,8 +7,6 @@
#ifndef _FWITKIO_IMAGEREADER_HPP_
#define _FWITKIO_IMAGEREADER_HPP_
#include <boost/filesystem/path.hpp>
#include <fwDataIO/reader/GenericObjectReader.hpp>
#include <fwData/location/SingleFile.hpp>
#include <fwData/Image.hpp>
......
......@@ -7,8 +7,6 @@
#ifndef _FWITKIO_IMAGEWRITER_HPP_
#define _FWITKIO_IMAGEWRITER_HPP_
#include <boost/filesystem/path.hpp>
#include <fwDataIO/writer/GenericObjectWriter.hpp>
#include <fwData/location/SingleFile.hpp>
#include <fwTools/ProgressAdviser.hpp>
......
......@@ -4,8 +4,8 @@
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _ITKIO_PROGESSITKTOFW_HPP_
#define _ITKIO_PROGESSITKTOFW_HPP_
#ifndef __FWITKIO_HELPER_PROGESSITKTOFW_HPP__
#define __FWITKIO_HELPER_PROGESSITKTOFW_HPP__
#include <itkCommand.h>
#include <itkProcessObject.h>
......@@ -62,7 +62,6 @@ class Progressor
}
#include "fwItkIO/helper/ProgressItkToFw.hxx"
#endif /* _ITKIO_PROGESSITKTOFW_HPP_ */
#endif /* __FWITKIO_HELPER_PROGESSITKTOFW_HPP__ */
......@@ -32,7 +32,7 @@ public:
itk::LightProcessObject* po = dynamic_cast<itk::LightProcessObject*>(caller);
if( !po ) return;
float percent = po->GetProgress();
OSLM_TRACE("LocalCommand::Execute" << m_msg << " " << percent );
OSLM_TRACE("LocalCommand::Execute '" << m_msg << "' " << percent );
m_adviser->notifyProgress( percent , m_msg );
}
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _FWITKIO_ITKPP_HPP_
#define _FWITKIO_ITKPP_HPP_
#include <boost/shared_ptr.hpp>
#include <itkpp/MaskScanner.h>
#include <itkpp/ImageWithScanner.h>
#include <itkpp/ImageToImageFilterForImageWithScanner.h>
#include <itkpp/ImageWithScannerIteratorCollection.h>
#include <fwData/Image.hpp>
#include "fwItkIO/config.hpp"
namespace fwItkIO
{
/*
* Create an image with scanner
* ITKIMAGE template parameter must be instantiated with itk::Image< PIXELTYPE , VDIM > and not with itk::ImageWithScanner< PIXELTYPE , VDIM >,
* otherwise the cast filter will wait for
*/
template< class PIXELTYPE , int VDimension , class ScannerType >
typename ScannerType::Pointer itkppScannerFactory( ::fwData::Image::sptr imageData);
}
#include "fwItkIO/itkpp.hxx"
#endif // _FWITKIO_ITKPP_HPP_
......@@ -4,11 +4,11 @@
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef itk_InrImageIO_h
#define itk_InrImageIO_h
#ifndef __FWITKIO_INR2ITK_INRIMAGEIO_HPP__
#define __FWITKIO_INR2ITK_INRIMAGEIO_HPP__
#include <fstream>
#include "itkImageIOBase.h"
#include <itkImageIOBase.h>
#include "fwItkIO/config.hpp"
......@@ -28,28 +28,28 @@ public :
typedef InrImageIO Self;
typedef ImageIOBase SuperClass;
typedef SmartPointer<Self> Pointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(InrImageIO, Superclass);
/*-------- This part of the interfaces deals with reading data. ----- */
/** Determine if the file can be read with this ImageIO implementation.
* \param FileNameToRead The name of the file to test for reading.
* \post Sets classes ImageIOBase::m_FileName variable to be FileNameToWrite
* \return Returns true if this ImageIO can read the file specified.
*/
virtual bool CanReadFile(const char* FileNameToRead);
/** Set the spacing and dimension information for the set filename. */
virtual void ReadImageInformation();
/** Reads the data from disk into the memory buffer provided. */
virtual void Read(void* buffer);
/*-------- This part of the interfaces deals with writing data. ----- */
/** Determine if the file can be written with this ImageIO implementation.
......@@ -65,7 +65,7 @@ public :
/** Writes the data to disk from the memory buffer provided. Make sure
* that the IORegions has been set properly. */
virtual void Write(const void* buffer);
protected:
FWITKIO_API InrImageIO();
FWITKIO_API ~InrImageIO();
......@@ -73,11 +73,11 @@ protected:
private:
InrImageIO(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
std::streampos m_headerSize;
//bool m_swapBytes;
}; // class InrImageIO()
} // namespace itk
#endif // itk_InrImageIO_h
#endif // __FWITKIO_INR2ITK_INRIMAGEIO_HPP__
......@@ -4,15 +4,15 @@
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef itk_InrImageIOFactory_h
#define itk_InrImageIOFactory_h
#ifndef __FWITKIO_INR2ITK_INRIMAGEIOFACTORY_HPP__
#define __FWITKIO_INR2ITK_INRIMAGEIOFACTORY_HPP__
#include "itkObjectFactoryBase.h"
#include "itkImageIOBase.h"
#include <itkObjectFactoryBase.h>
#include <itkImageIOBase.h>
namespace itk
{
/**
/**
* \class InrImageIOFactory
* \brief Create instances of InrImageIO objects using an object factory.
*/
......@@ -53,8 +53,7 @@ private:
};
} // end namespace itk
#endif // itk_InrImageIOFactory_h
#endif // __FWITKIO_INR2ITK_INRIMAGEIOFACTORY_HPP__
......@@ -6,14 +6,12 @@
#include <boost/filesystem.hpp>
#include <fwCore/base.hpp>
#include <itkImageFileReader.h>
#include <itkImageIOFactory.h>
#include <fwCore/base.hpp>
#include <fwData/Image.hpp>
#include <fwItkIO/itk.hpp>
#include <fwTools/IntrinsicTypes.hpp>
#include <fwTools/Dispatcher.hpp>
......@@ -21,8 +19,9 @@
#include <fwDataIO/reader/registry/macros.hpp>
#include "inr2itk/itkInrImageIOFactory.h"
#include "inr2itk/itkInrImageIOFactory.hpp"
#include "fwItkIO/itk.hpp"
#include "fwItkIO/ImageReader.hpp"
#include "fwItkIO/helper/ProgressItkToFw.hpp"
......
......@@ -6,21 +6,19 @@
#include <boost/filesystem.hpp>
#include <fwCore/base.hpp>
#include <itkImageFileWriter.h>
#include <fwTools/IntrinsicTypes.hpp>
#include <fwTools/DynamicTypeKeyTypeMapping.hpp>
#include <fwTools/Dispatcher.hpp>
#include <fwItkIO/itk.hpp>
#include <fwTools/IntrinsicTypes.hpp>
#include <fwTools/DynamicTypeKeyTypeMapping.hpp>
#include <fwCore/base.hpp>
#include <fwDataIO/writer/registry/macros.hpp>
#include "fwItkIO/itk.hpp"
#include "fwItkIO/helper/ProgressItkToFw.hpp"
#include "fwItkIO/ImageWriter.hpp"
......@@ -105,7 +103,7 @@ void ImageWriter::write()
saverParam.m_fwWriter = this->getSptr();
assert( saverParam.m_dataImage );
fwTools::Dispatcher< fwTools::IntrinsicTypes , ITKSaverFunctor >::invoke( saverParam.m_dataImage->getPixelType(), saverParam );
::fwTools::Dispatcher< fwTools::IntrinsicTypes , ITKSaverFunctor >::invoke( saverParam.m_dataImage->getPixelType(), saverParam );
}
......
......@@ -11,6 +11,7 @@
#include <itkImageSeriesWriter.h>
#include <itkNumericSeriesFileNames.h>
#include <itkIntensityWindowingImageFilter.h>
#include <itkJPEGImageIOFactory.h>
#include <fwTools/IntrinsicTypes.hpp>
#include <fwTools/DynamicTypeKeyTypeMapping.hpp>
......@@ -26,10 +27,9 @@
#include <fwData/Image.hpp>
#include <fwData/TransferFunction.hpp>
#include <fwItkIO/itk.hpp>
#include <fwDataIO/writer/registry/macros.hpp>
#include "fwItkIO/itk.hpp"
#include "fwItkIO/helper/ProgressItkToFw.hpp"
#include "fwItkIO/JpgImageWriter.hpp"
......@@ -59,6 +59,11 @@ JpgImageWriter::~JpgImageWriter()
struct JpgITKSaverFunctor
{
JpgITKSaverFunctor()
{
// force register/link_with JPEGImageIOFactory
::itk::JPEGImageIOFactory::RegisterOneFactory();
}
struct Parameter
{
std::string m_filename;
......
......@@ -19,7 +19,7 @@
#include <fwCore/spyLog.hpp>
#include <fwCore/Exception.hpp>
#include "inr2itk/itkInrImageIO.h"
#include "inr2itk/itkInrImageIO.hpp"
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) <= (b) ? (a) : (b))
......
......@@ -6,11 +6,11 @@
#include "fwItkIO/ImageIOFactoryRegistrar.hxx"
#include "inr2itk/itkInrImageIOFactory.h"
#include "inr2itk/itkInrImageIOFactory.hpp"
#include "itkCreateObjectFunction.h"
#include "inr2itk/itkInrImageIO.h"
#include "itkVersion.h"
#include <itkCreateObjectFunction.h>
#include "inr2itk/itkInrImageIO.hpp"
#include <itkVersion.h>
#include <fwCore/base.hpp>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment