[Insight-users] Some Errors occurred while using "itkObliqueSectionImageFilter.h"

Dan Mueller dan.muel at gmail.com
Mon Jan 14 19:00:56 EST 2013


Hi,

The errors you are experiencing when compiling
LookAtTransformInitalizer and ObliqueSectionImageFilter arise because
these classes were written for an older version of ITK.

In the newest version of ITK, the Rigid3DTransform no longer has a
New() function. This can be resolved by either:
1. Adding "#define ITKV3_COMPATIBILITY" to your source file
or
2. Setting the CMake flag ITKV3_COMPATIBILITY when you configure ITK.

I downloaded the source code from the Insight Journal
    http://www.insight-journal.org/browse/publication/168
and was able to compile the LookAtMain project using ITK 4.2.1 by
adding "#define ITKV3_COMPATIBILITY" at the top of main.cxx. (I also
needed to add "cmake_minimum_required(VERSION 2.8)" to the root
CMakeLists.txt file).

Hope this helps,

Regards, Dan

On 14 January 2013 21:06, 謝冠宇 <romanticamaj at gmail.com> wrote:
> Hi, Dan,
>
> I am a graduate student from Taiwan. My name is Kuan-Yu Hsieh.
>
> Recently, I need to extract a oblique slice from a 3D CT data.
>
> I found your work of  LookAt Transform Initializer and Oblique Section Image
> Filter
>
> I think this filter is a very useful filter, and this will be a big helper
> on my research.
>
>
> Anyway, please take a look, here are  the problems :
>
> the First Problem ---------------------
>
>     project "LookAtMain"  -> file "main.cxx"
>
>     TransformType::Pointer transform = TransformType::New();
>
> this itk::Rigid3DTransform< double > cannot be initialized
>
> because there is no appropriate user-defined  converter function to
> convert    itk::SmartPointer<itk::MatrixOffsetTransformBase<double,3U,3U>>
> to  itk::SmartPointer<Rigid3DTransform<double> >
>
>
>
>
> the Second Problem -------------------
>
> I try this function  "Test_LookAt_ObliqueSection"
>
> and when I compile it there is a error in "itkObliqueSectionImageFilter.h"
>
>          m_Transform = TransformType::New();
>
>
>
> 1> C:\source code\itkObliqueSectionImageFilter.txx(128): error C2679: 二元運算子
> '=' : 找不到使用右方運算元型別 'itk::SmartPointer<TObjectType>' 的運算子 (或是沒有可接受的轉換)
> 1>          with
> 1>          [
> 1>              TObjectType=itk::MatrixOffsetTransformBase<double,3,3>
> 1>          ]
>
> This probably is the same error just like the problem one has.
>
> Because my Visual Studio is Chinese version, there is a chance that i
> misunderstood the error message.
>
> I googled it, and I found this discussion list
>
> http://itk-insight-users.2283740.n2.nabble.com/Rigid3DTransform-make-error-td7160305.html
>
> I think my problem just like this discussion.
>
> I think this error is related to version of itk that I used, but I cannot
> figure out what should I do.
>
>
>
> I am just a new kid in this ITK town.
>
> For now, I cannot fix this error on my own.
>
> So if you can help me,  I will very very appreciate.
>
>
>
>
> For your information, my platform is Window 7 64-bit + Visual Studio 2010
> Professional + itk 4.2.1
>
> And the attachments are screenshots of the error.
>
> Thanks a lot in advance. : )


More information about the Insight-users mailing list