[ITK-users] Building testing application for N3 implementation

Jan Dorazil deu439 at gmail.com
Tue May 5 10:40:28 EDT 2015


Thank you Nicholas,

I followed your advice, and cloned the ANTs repository, although I was not 
able to compile it with my ITK version (4.7.1-1) so I let cmake clone and
compile another version of ITK to get it working.
Now all the examples are working.

I used the N4BiasFieldCorrection.cxx example from ANTs to implement
bias correction into my application and it's working even with my ITK
version. The only problem I got is that when I try to add observer to
the N4BiasFieldCorrectionFilter using the same bunch of calls as in the
example application:
--
  typedef itk::CommandIterationUpdate<N4Type> CommandType;
  CommandType::Pointer observer = CommandType::New();
  corrector->AddObserver( itk::IterationEvent(), observer );
--
I get a lot of errors during compilation complaining about non-existence of 
methods 'GetCurrentIteration()', 'GetValue()', 'GetCurrentPosition()', 
'GetStopCondition()' 
--
/usr/include/ITK-4.7/itkCommandIterationUpdate.h:74:17: error: 
‘itk::WeakPointer<itk::N4BiasFieldCorrectionImageFilter<itk::Image<float, 3u>, 
itk::Image<unsigned char, 3u> > >::ObjectType’ has no member named 
‘GetCurrentIteration’
       std::cout << m_Optimizer->GetCurrentIteration() << " = ";
--
Has anything changed in  the interface, or am I doing something wrong?

Regards,
Jan Dorazil

On Saturday 02 of May 2015 08:38:35 you wrote:
> Thanks Bill.
> 
> Also, Jan, I know I should probably should keep that submission
> updated, but we’re all busy and things like that fall through the
> cracks of my to-do list.  However, in addition to the ITK class being
> updated and tested continually by the wonderful ITK folk, we keep
> both the N3 and N4 programs updated in our ANTs repository, in
> case you’re interested.
> 
> https://github.com/stnava/ANTs/blob/master/Examples/N3BiasFieldCorrection.cx
> x
> https://github.com/stnava/ANTs/blob/master/Examples/N4BiasFieldCorrection.c
> xx
> 
> Nick
> 
> > On May 2, 2015, at 8:02 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> > 
> > This is an older implementation. ITK currently has
> > N4BiasFieldCorrectionImageFilter. I would try this instead. It is in
> > Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilt
> > e
> > 
> > Bill
> > 
> > On Sat, May 2, 2015 at 10:12 AM, Jan Dorazil <deu439 at gmail.com> wrote:
> >> Hello,
> >> I am currently working on some MRI images and, would like to
> >> test the ITK implementation of the N3 algorithm for MRI Bias
> >> Field correction.
> >> I have downloaded the source code for a
> >> testing application
> >> (http://www.insight-journal.org/browse/publication/640)
> >> but cant manage to compile it.
> >> As I try to configure the package using cmake I get this error:
> >> --
> >> 
> >> CMake Error at CMakeLists.txt:20 (INCLUDE):
> >>  include could not find load file:
> >>    /usr/share/cmake-3.2/Modules/FindITK.cmake
> >> 
> >> --
> >> I looked inside the supplied CMakeLists.txt and found out it is this
> >> portion thats causing the error.
> >> --
> >> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> >> IF (USE_ITK_FILE)
> >> 
> >>  INCLUDE(${USE_ITK_FILE})
> >> 
> >> ENDIF(USE_ITK_FILE)
> >> --
> >> What's the problem here? Shouldnt ITK installation
> >> install the FindITK.cmake? I have not found it anywhere  on
> >> my disc. Anyway, why dont other packages require this
> >> file - I have already built a lot of ITK applications.
> >> 
> >> ITK version: 4.7.1-1
> >> cmake version 3.2.2
> >> #uname -a
> >> Linux Clifford 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015
> >> x86_64 GNU/Linux
> >> 
> >> Regards,
> >> Jan Dorazil
> >> _____________________________________
> >> Powered by www.kitware.com
> >> 
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >> 
> >> Kitware offers ITK Training Courses, for more information visit:
> >> http://www.kitware.com/products/protraining.php
> >> 
> >> Please keep messages on-topic and check the ITK FAQ at:
> >> http://www.itk.org/Wiki/ITK_FAQ
> >> 
> >> Follow this link to subscribe/unsubscribe:
> >> http://public.kitware.com/mailman/listinfo/insight-users



More information about the Insight-users mailing list