[Insight-users] build error c3855
barbababa
tonimuusimaki at gmail.com
Sat Dec 3 17:43:29 EST 2011
This worked fine when i was using visual c++ 7 with release win32
Here:
dmtoitk4.h
#ifndef GATANPLUGIN_USES_LIBRARY_VERSION
#define _GATANPLUGIN_USES_LIBRARY_VERSION 2
#endif
#ifndef _DMPlugInBasic_h_INCLUDED__
#include "DMPlugInBasic.h"
#endif
#ifndef _itkImage_h_INCLUDED__
#include <itkImage.h>
#endif
typedef itk::Image< float, 4 > ItkImage4;
#include "itkImportImageFilter.h"
using namespace Gatan;
ItkImage4::Pointer dmtoitk4( DM::Image );
dmtoitk4.cpp
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
typedef float PixelType;
#include "dmtoitk4.h"
ItkImage4::Pointer dmtoitk4( DM::Image input )
{
PLUG_IN_ENTRY
typedef itk::ImportImageFilter< PixelType, 4> ImportFilterType;
ImportFilterType::Pointer importFilter = ImportFilterType::New();
ImportFilterType::SizeType size;
size[0] = input.GetDimensionSize( 0 );
size[1] = input.GetDimensionSize( 1 );
size[2] = input.GetDimensionSize( 2 );
size[3] = input.GetDimensionSize( 3 );
ImportFilterType::IndexType start;
start.Fill( 0 );
ImportFilterType::RegionType region;
region.SetIndex( start );
region.SetSize( size );
importFilter->SetRegion( region );
double origin[4 ];
origin[0] = 0.0; // X coordinate
origin[1] = 0.0; // X coordinate
origin[2] = 0.0; // X coordinate
origin[3] = 0.0;
importFilter->SetOrigin( origin );
double spacing[ 4];
spacing[0] = 1.0; // along X direction
spacing[1] = 1.0; // along X direction
spacing[2] = 1.0; // along X direction
spacing[3] = 1.0;
importFilter->SetSpacing( spacing );
const unsigned int numberOfPixels = size[0]*size[1]*size[2]*size[3] ;
const bool importImageFilterWillOwnTheBuffer = false;
Gatan::PlugIn::ImageDataLocker inputl( input,
PlugIn::ImageDataLocker::lock_data_CONTIGUOUS );
PixelType *input_data ;
input_data = (PixelType *) ( inputl.get_image_data().get_data() );
importFilter->SetImportPointer(input_data, numberOfPixels,
importImageFilterWillOwnTheBuffer );
importFilter->Update();
ItkImage4::Pointer output = importFilter->GetOutput();
output->DisconnectPipeline();
return output;
PLUG_IN_EXIT
}
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/build-error-c3855-tp7058835p7058879.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list