Skip to content

Commit

Permalink
ENH: wrap RTK image IO
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Mar 18, 2020
1 parent df54c6f commit 9a9d214
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/rtkHncImageIOFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef rtkHncImageIOFactory_h
#define rtkHncImageIOFactory_h

#include "RTKExport.h"
#include "rtkHncImageIO.h"

// itk include
Expand Down
9 changes: 9 additions & 0 deletions itk-module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ itk_module(RTK
${RTK_DEPENDS}
TEST_DEPENDS
${RTK_TEST_DEPENDS}
FACTORY_NAMES
ImageIO::DCMImagX
ImageIO::His
ImageIO::Hnc
ImageIO::Hnd
ImageIO::ImagX
ImageIO::Ora
ImageIO::Xim
ImageIO::XRad
DESCRIPTION
"${DOCUMENTATION}"
)
20 changes: 20 additions & 0 deletions src/rtkDCMImagXImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,23 @@ rtk::DCMImagXImageIOFactory::DCMImagXImageIOFactory()
true,
itk::CreateObjectFunction<DCMImagXImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool DCMImagXImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
DCMImagXImageIOFactoryRegister__Private()
{
if (!DCMImagXImageIOFactoryHasBeenRegistered)
{
DCMImagXImageIOFactoryHasBeenRegistered = true;
rtk::DCMImagXImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
21 changes: 20 additions & 1 deletion src/rtkHisImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,28 @@

#include <fstream>

//====================================================================
rtk::HisImageIOFactory::HisImageIOFactory()
{
this->RegisterOverride(
"itkImageIOBase", "HisImageIO", "His Image IO", true, itk::CreateObjectFunction<HisImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool HisImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
HisImageIOFactoryRegister__Private()
{
if (!HisImageIOFactoryHasBeenRegistered)
{
HisImageIOFactoryHasBeenRegistered = true;
rtk::HisImageIOFactory::RegisterOneFactory();
}
}

} // end namespace rtk
20 changes: 20 additions & 0 deletions src/rtkHncImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ rtk::HncImageIOFactory::HncImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "HncImageIO", "Hnc Image IO", 1, itk::CreateObjectFunction<HncImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool HncImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
HncImageIOFactoryRegister__Private()
{
if (!HncImageIOFactoryHasBeenRegistered)
{
HncImageIOFactoryHasBeenRegistered = true;
rtk::HncImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
20 changes: 20 additions & 0 deletions src/rtkHndImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ rtk::HndImageIOFactory::HndImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "HndImageIO", "Hnd Image IO", true, itk::CreateObjectFunction<HndImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool HndImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
HndImageIOFactoryRegister__Private()
{
if (!HndImageIOFactoryHasBeenRegistered)
{
HndImageIOFactoryHasBeenRegistered = true;
rtk::HndImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
20 changes: 20 additions & 0 deletions src/rtkImagXImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,23 @@ rtk::ImagXImageIOFactory::ImagXImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "ImagXImageIO", "ImagX Image IO", true, itk::CreateObjectFunction<ImagXImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool ImagXImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
ImagXImageIOFactoryRegister__Private()
{
if (!ImagXImageIOFactoryHasBeenRegistered)
{
ImagXImageIOFactoryHasBeenRegistered = true;
rtk::ImagXImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
20 changes: 20 additions & 0 deletions src/rtkOraImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ rtk::OraImageIOFactory::OraImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "OraImageIO", "Ora Image IO", true, itk::CreateObjectFunction<OraImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool OraImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
OraImageIOFactoryRegister__Private()
{
if (!OraImageIOFactoryHasBeenRegistered)
{
OraImageIOFactoryHasBeenRegistered = true;
rtk::OraImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
20 changes: 20 additions & 0 deletions src/rtkXRadImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,23 @@ rtk::XRadImageIOFactory::XRadImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "XRadImageIO", "XRad Image IO", true, itk::CreateObjectFunction<XRadImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool XRadImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
XRadImageIOFactoryRegister__Private()
{
if (!XRadImageIOFactoryHasBeenRegistered)
{
XRadImageIOFactoryHasBeenRegistered = true;
rtk::XRadImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
20 changes: 20 additions & 0 deletions src/rtkXimImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ rtk::XimImageIOFactory::XimImageIOFactory()
this->RegisterOverride(
"itkImageIOBase", "XimImageIO", "Xim Image IO", true, itk::CreateObjectFunction<XimImageIO>::New());
}

// Undocumented API used to register during static initialization.
// DO NOT CALL DIRECTLY.

namespace itk
{

static bool XimImageIOFactoryHasBeenRegistered;

void RTK_EXPORT
XimImageIOFactoryRegister__Private()
{
if (!XimImageIOFactoryHasBeenRegistered)
{
XimImageIOFactoryHasBeenRegistered = true;
rtk::XimImageIOFactory::RegisterOneFactory();
}
}

} // end namespace itk
2 changes: 2 additions & 0 deletions wrapping/rtkDCMImagXImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::DCMImagXImageIO" POINTER)
itk_wrap_simple_class("rtk::DCMImagXImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkEdfImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::EdfImageIO" POINTER)
itk_wrap_simple_class("rtk::EdfImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkHisImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::HisImageIO" POINTER)
itk_wrap_simple_class("rtk::HisImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkHncImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::HncImageIO" POINTER)
itk_wrap_simple_class("rtk::HncImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkHndImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::HndImageIO" POINTER)
itk_wrap_simple_class("rtk::HndImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkImagXImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::ImagXImageIO" POINTER)
itk_wrap_simple_class("rtk::ImagXImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkOraImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::OraImageIO" POINTER)
itk_wrap_simple_class("rtk::OraImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkXRadImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::XRadImageIO" POINTER)
itk_wrap_simple_class("rtk::XRadImageIOFactory" POINTER)
2 changes: 2 additions & 0 deletions wrapping/rtkXimImageIO.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
itk_wrap_simple_class("rtk::XimImageIO" POINTER)
itk_wrap_simple_class("rtk::XimImageIOFactory" POINTER)

0 comments on commit 9a9d214

Please sign in to comment.