[Insight-users] RE: Insight-users Digest, Vol 29, Issue 16

Xuelin Cui xuelin at hawaii.edu
Fri Sep 8 03:05:44 EDT 2006


cool

-----Original Message-----
From: insight-users-bounces+xuelin=hawaii.edu at itk.org
[mailto:insight-users-bounces+xuelin=hawaii.edu at itk.org] On Behalf Of
insight-users-request at itk.org
Sent: Saturday, September 09, 2006 4:01 AM
To: insight-users at itk.org
Subject: Insight-users Digest, Vol 29, Issue 16

Send Insight-users mailing list submissions to
	insight-users at itk.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://www.itk.org/mailman/listinfo/insight-users
or, via email, send a message with subject or body 'help' to
	insight-users-request at itk.org

You can reach the person managing the list at
	insight-users-owner at itk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Insight-users digest..."


Today's Topics:

   1. LINK errors when extending insight applications (Eve)
   2. No test for svd? Update. (Frank Miller)
   3. itkSymmetricEigenAnalysisImageFilter Problem (Alberto Santamarma)


----------------------------------------------------------------------

Message: 1
Date: Fri, 8 Sep 2006 12:05:56 -0700 (PDT)
From: Eve <evelyn_heyes at homeworking.org>
Subject: [Insight-users] LINK errors when extending insight
	applications
To: insight-users at itk.org
Message-ID: <6215014.post at talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hello ITK-users,

I am currently trying to modify the Image Registration application. The
directory tree I have setup is:

-InsightApplications

--- Auxillary
...

-- Build 
------Auxilary
------ImageRegistration
-----------Debug

-- ImageRegistration
...


My first question is, when modifying the source code for ImageRegistration/
ImageViewer, which project should I open:
1. InsightApplications > Build > ImageRegistration.vcproj
or
2. InsightApplications > Build > ImageRegistration >
ImageRegistration.vcproj


This question arose because I got the following link errors:

Linking...
   Creating library Debug\ImageRegistration2D.lib and object
Debug\ImageRegistration2D.exp
ImageRegistrationConsole.obj : error LNK2001: unresolved external symbol
"public: virtual void __thiscall
ImageRegistrationConsole::SaveValidationImage(void)"
(?SaveValidationImage at ImageRegistrationConsole@@UAEXXZ)
ImageRegistrationConsole.obj : error LNK2001: unresolved external symbol
"public: virtual void __thiscall
fltkImageViewerGUI::SaveClickedPoints(void)"
(?SaveClickedPoints at fltkImageViewerGUI@@UAEXXZ)
Debug\ImageRegistration2D.exe : fatal error LNK1120: 2 unresolved externals

Build log was saved at
"file://h:\codes\applic\InsightApplications\build7\ImageRegistration2D\Debug
\BuildLog.htm"
ImageRegistration2D - 3 error(s), 0 warning(s)

The cmakelists file is attached.

The second question: Is it necessary to input colortable for the overlaid
image when the fltk::ImageViewerGUI is used? The overlaid image I got
currently is shown in monotone. I have attempted to use a specified
colormap, but the same overlay is shown. I have attempted to extend the
fltk::ImageViewer but got the similar LINK errors.

Thank you for your help!

Best,
Eve

http://www.nabble.com/user-files/235922/CMakeLists.txt CMakeLists.txt 
http://www.nabble.com/user-files/235923/screenshot.png 
-- 
View this message in context:
http://www.nabble.com/LINK-errors-when-extending-insight-applications-tf2240
911.html#a6215014
Sent from the ITK - Users forum at Nabble.com.



------------------------------

Message: 2
Date: Fri, 08 Sep 2006 15:29:47 -0400
From: Frank Miller <frankmiller at jhmi.edu>
Subject: [Insight-users] No test for svd? Update.
To: insight-users at itk.org
Message-ID: <4501C4AB.1010204 at jhmi.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

This appears to be an upstream problem. I downloaded vxl and there is no 
"test_svd" there either.

However, on a more positive note, I recompiled itk with -O2 
optimization, instead of -O3, and the problem seems to be gone.

Optimization bugs are the worst.

Frank

Frank Miller wrote:
> Greetings,
> 
> Im having a very strange problem with the svd algorithm. My experience 
> is consistent with the problem mentioned in the comments at line 92 in 
> the file
> 
>   Utilities/vxl/core/vnl/algo/vnl_svd.txx
> 
> If this is the source of my problem, the comments state that the 
> "core/vnl/tests/test_svd" should have failed. However, I cant find this 
> test. I turned BUILD_TESTING on and there is no "test_svd". There is a 
> "vnl_test_all" which when run states that
> 
>   The registered test names are:
>      test_bignum
>      test_complex
>      test_inverse
>      test_diag_matrix
>      test_file_matrix
>      test_finite
>      test_math
>      test_matrix
>      test_matrix_exp
>      test_matrix_fixed
>      test_matrix_fixed_ref
>      test_numeric_traits
>      test_rational
>      test_real_polynomial
>      test_resize
>      test_sample
>      test_sym_matrix
>      test_transpose
>      test_fastops
>      test_vector
>      test_vector_fixed_ref
>      test_gamma
>      test_random
>      test_arithmetic
>      test_hungarian_algorithm
>      test_integrant
>      test_bessel
> 
> all of which pass on my system.
> 
> How can I run this test on my system? Is this test not being run by 
> Dart? Any help would be much appreciated,
> 
> 
> Below is some more details if you are interested.
> 
> My system is 32bit Linux, my cpu is Intel Xeon, my compiler is 
> gcc-4.1.1, and Im using itk-2.8.1.
> 
> When updating any pipeline that has a particular image as an input, I 
> get the following message printed to standard error:
> 
>   /home/frank/opt/src/itk/2.8.1/InsightToolkit-2.8.1/Utilities/vxl/core/
>   vnl/algo/vnl_svd.txx: suspicious return value (3) from SVDC
>   /home/frank/opt/src/itk/2.8.1/InsightToolkit-2.8.1/Utilities/vxl/core/
>   vnl/algo/vnl_svd.txx: M is 3x3
>   M = [ ...
>    0.9788850881159 -0.1393774186727 -5.6885917960696
>    1.0096153244376  0.1351351488847  5.5154448566180
>    0.0000000300788 -1.3927854783833  1.1043995835373  ]
> 
> The correct singular values for M are, according to octave, 8.0000, 
> 1.4063, 1.4062.
> 
> Here is a trace of the image:
> 
>   OrientedImage (0x83f0000)
>     RTTI typeinfo:   itk::OrientedImage<int, 3u>
>     Reference Count: 6
>     Modified Time: 714
>     Debug: Off
>     Observers:
>       none
>     Source: (0x83eb4c8)
>     Source output index: 0
>     Release Data: On
>     Data Released: False
>     Global Release Data: Off
>     PipelineMTime: 238
>     UpdateMTime: 715
>     LargestPossibleRegion:
>       Dimension: 3
>       Index: [0, 0, 0]
>       Size: [256, 256, 17]
>     BufferedRegion:
>       Dimension: 3
>       Index: [0, 0, 0]
>       Size: [256, 256, 17]
>     RequestedRegion:
>       Dimension: 3
>       Index: [0, 0, 0]
>       Size: [256, 256, 17]
>     Spacing: [1.40625, 1.40625, 7.99999]
>     Origin: [-37.7846, -241.523, 175.909]
>     Direction:
>   0.696096 -0.0991128 -0.711074
>   0.717949 0.0960961 0.689431
>   2.13894e-08 -0.990425 0.13805
> 
>     PixelContainer:
>       ImportImageContainer (0x83f01b8)
>         RTTI typeinfo:   itk::ImportImageContainer<unsigned long, int>
>         Reference Count: 1
>         Modified Time: 288
>         Debug: Off
>         Observers:
>           none
>         Pointer: 0x83f01e8
>         Container manages memory: true
>         Size: 1114112
>         Capacity: 1114112
> 
> Thanks,
> 
> Frank
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


------------------------------

Message: 3
Date: Fri, 8 Sep 2006 13:00:27 -0700 (PDT)
From: Alberto "Santamarma" <pang2 at yahoo.com>
Subject: [Insight-users] itkSymmetricEigenAnalysisImageFilter Problem
To: insight-users at itk.org
Message-ID: <20060908200027.89233.qmail at web32109.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Dear All,

I am trying to compute the eigenvalues from a volume
of size: 512x512x120 with data type ushort. 
However once the Hessian has been computed, the
program chrases giving me the following error:

*** glibc detected *** free(): invalid next size
(fast): 0x00000000009a74c0 ***
Aborted

The compiler that I use is:
c++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)

and is running in a cluster with 8 CPUS of the type:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 846
stepping        : 10
cpu MHz         : 2004.566
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8
apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr
sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 4014.85
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

"itkSymmetricEigenAnalysisImageFilter.h"

I tracked down the problem with valgrind and this is
the initial part of the report. I have attached the
complete error log.

==22307== Warning: set address range perms: large
range 342884360 (undefined)
==22307== Thread 4:
==22307== Invalid write of size 8
==22307==    at 0x4AE4B1:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double,
3>, itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float,
3>&, double*) 
const (itkSymmetricEigenAnalysis.txx:483)


Has any one faced a similar problem to this one
before?

Thanks in advance

-Alberto

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
==22307== Memcheck, a memory error detector.
==22307== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==22307== Using LibVEX rev 1606, a library for dynamic binary translation.
==22307== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==22307== Using valgrind-3.2.0, a dynamic binary instrumentation framework.
==22307== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==22307== For more details, rerun with: -v
==22307== 
==22307== Warning: set address range perms: large range 114294784
(undefined)
Computing hessian set to  0.4...
==22307== Warning: set address range perms: large range 1371537416
(undefined)
==22307== Warning: set address range perms: large range 114294784
(undefined)

==22307== Warning: set address range perms: large range 114294784
(undefined)
==22307== Warning: set address range perms: large range 114294784
(undefined)
Computing hessian set to  0.4...Done
==22307== Warning: set address range perms: large range 342884360
(undefined)
==22307== Thread 4:
==22307== Invalid write of size 8
==22307==    at 0x4AE4B1:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (itkSymmetricEigenAnalysis.txx:483)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307==  Address 0xBCA6268 is 0 bytes after a block of size 24 alloc'd
==22307==    at 0x4905415: operator new[](unsigned long)
(vg_replace_malloc.c:199)
==22307==    by 0x4AE73B:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:32)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4AE5FF:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (itkFixedArray.h:181)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4AE2DD:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (itkSymmetricEigenAnalysis.txx:433)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4AE375:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (vnl_math.h:158)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Invalid read of size 8
==22307==    at 0x4AE44D:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (itkSymmetricEigenAnalysis.txx:473)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307==  Address 0xBCA6268 is 0 bytes after a block of size 24 alloc'd
==22307==    at 0x4905415: operator new[](unsigned long)
(vg_replace_malloc.c:199)
==22307==    by 0x4AE73B:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:32)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4A8E4D:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ReduceToTridiagonalMatrix(double*, itk::FixedArray<float, 3>&, 
double*, double*) const (itkSymmetricEigenAnalysis.txx:138)
==22307==    by 0x4AE7AA:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:47)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4A8F16:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ReduceToTridiagonalMatrix(double*, itk::FixedArray<float, 3>&, 
double*, double*) const (itkSymmetricEigenAnalysis.txx:158)
==22307==    by 0x4AE7AA:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:47)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4A8F1C:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ReduceToTridiagonalMatrix(double*, itk::FixedArray<float, 3>&, 
double*, double*) const (itkSymmetricEigenAnalysis.txx:158)
==22307==    by 0x4AE7AA:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:47)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4A8E4F:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ReduceToTridiagonalMatrix(double*, itk::FixedArray<float, 3>&, 
double*, double*) const (itkSymmetricEigenAnalysis.txx:138)
==22307==    by 0x4AE7AA:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:47)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== Conditional jump or move depends on uninitialised value(s)
==22307==    at 0x4AE2DF:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValuesUsingQL(itk::FixedArray<float, 3>&, double*) 
const (itkSymmetricEigenAnalysis.txx:433)
==22307==    by 0x4AE7BB:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<flo
at, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> co
nst&, itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:49)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk
::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
d
ouble, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAn
alysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkS
martPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307== More than 10000000 total errors detected.  I'm not reporting any
more.
==22307== Final error counts will be inaccurate.  Go fix your program!
==22307== Rerun with --error-limit=no to disable this cutoff.  Note
==22307== that errors may occur in your program without prior warning from
==22307== Valgrind, because errors are no longer being displayed.
==22307== 
==22307== 
==22307== ERROR SUMMARY: 10000000 errors from 11 contexts (suppressed: 10
from 5)
==22307== malloc/free: in use at exit: 2,172,495,740 bytes in 13,998 blocks.
==22307== malloc/free: 4,316,909 allocs, 4,302,911 frees, 2,436,566,755
bytes allocated.
==22307== For counts of detected errors, rerun with: -v
==22307== searching for pointers to 13,998 not-freed blocks.
==22307== checked 1,921,180,184 bytes.
==22307== 
==22307== Thread 1:
==22307== 
==22307== 37 bytes in 1 blocks are possibly lost in loss record 38 of 206
==22307==    at 0x4904F57: operator new(unsigned long)
(vg_replace_malloc.c:167)
==22307==    by 0x313E69024D: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E6902EB:
std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E6903D9: std::string::string(std::string const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x58A4C6: gdcm::Util::GetMACAddress() (gdcmUtil.cxx:897)
==22307==    by 0x58BCAB: _GLOBAL__I__ZN4gdcm4Util8GDCM_UIDE
(gdcmUtil.cxx:108)
==22307==    by 0x689B05: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307==    by 0x483992: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307== 
==22307== 
==22307== 47 bytes in 1 blocks are possibly lost in loss record 40 of 206
==22307==    at 0x4904F57: operator new(unsigned long)
(vg_replace_malloc.c:167)
==22307==    by 0x313E69024D: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E6902EB:
std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E6906C9: std::string::assign(std::string const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x54C8A4: gdcm::DictSet::DictSet() (basic_string.h:427)
==22307==    by 0x56A3B8: gdcm::Global::Global() (gdcmGlobal.cxx:70)
==22307==    by 0x56B48E: _GLOBAL__I__ZN4gdcm12GDCM_UNKNOWNE
(gdcmGlobal.cxx:56)
==22307==    by 0x689B05: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307==    by 0x483992: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307== 
==22307== 
==22307== 195 bytes in 3 blocks are possibly lost in loss record 119 of 206
==22307==    at 0x4904F57: operator new(unsigned long)
(vg_replace_malloc.c:167)
==22307==    by 0x313E69024D: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E6902EB:
std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E690792: std::string::reserve(unsigned long) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E69109B: std::string::append(std::string const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x486F33: std::basic_string<char, std::char_traits<char>,
std::allocator<char> > std::operator+<char, std::char_traits<char>,
std::allocator<char> >(std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) (basic_string.h:2006)
==22307==    by 0x48553F: main (basic_string.h:2041)
==22307== 
==22307== 
==22307== 216 bytes in 3 blocks are definitely lost in loss record 120 of
206
==22307==    at 0x4905415: operator new[](unsigned long)
(vg_replace_malloc.c:199)
==22307==    by 0x4AE74E:
itk::SymmetricEigenAnalysis<itk::SymmetricSecondRankTensor<double, 3>,
itk::FixedArray<float, 3>, itk::SymmetricSecondRankTensor<double, 3>
>::ComputeEigenValues(itk::SymmetricSecondRankTensor<double, 3> const&,
itk::FixedArray<float, 3>&) const (itkSymmetricEigenAnalysis.txx:35)
==22307==    by 0x4B3E69:
itk::UnaryFunctorImageFilter<itk::Image<itk::SymmetricSecondRankTensor<doubl
e, 3>, 3>, itk::Image<itk::FixedArray<float, 3>, 3>,
itk::Functor::SymmetricEigenAnalysisFunction<itk::SymmetricSecondRankTensor<
double, 3>, itk::FixedArray<float, 3> >
>::ThreadedGenerateData(itk::ImageRegion<3> const&, int)
(itkSymmetricEigenAnalysisImageFilter.h:57)
==22307==    by 0x4A3645: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::ThreaderCallback(void*) (itkSmartPointer.h:71)
==22307==    by 0x4B87D6: itk::MultiThreader::SingleMethodProxy(void*)
(itkMultiThreader.cxx:736)
==22307==    by 0x313D806109: start_thread (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x313CFC68B2: clone (in /lib64/tls/libc-2.3.4.so)
==22307== 
==22307==
==22307== 2,016 bytes in 7 blocks are possibly lost in loss record 154 of
206
==22307==    at 0x49060CD: calloc (vg_replace_malloc.c:279)
==22307==    by 0x313CD0D262: _dl_allocate_tls (in /lib64/ld-2.3.4.so)
==22307==    by 0x313D806706: pthread_create@@GLIBC_2.2.5 (in
/lib64/tls/libpthread-2.3.4.so)
==22307==    by 0x4B92FF:
itk::MultiThreader::DispatchSingleMethodThread(itk::MultiThreader::ThreadInf
oStruct*) (itkMultiThreader.cxx:854)
==22307==    by 0x4BA281: itk::MultiThreader::SingleMethodExecute()
(itkMultiThreader.cxx:278)
==22307==    by 0x4A3580: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::GenerateData() (itkProcessObject.h:278)
==22307==    by 0x4C47EC:
itk::ProcessObject::UpdateOutputData(itk::DataObject*)
(itkProcessObject.cxx:991)
==22307==    by 0x4857B7: main (itkSmartPointer.h:71)
==22307== 
==22307== 
==22307== 19,468 bytes in 419 blocks are possibly lost in loss record 198 of
206
==22307==    at 0x4904F57: operator new(unsigned long)
(vg_replace_malloc.c:167)
==22307==    by 0x313E69024D: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E69094A: std::string::_M_mutate(unsigned long, unsigned
long, unsigned long) (in /usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E690C31: std::string::assign(char const*, unsigned
long) (in /usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x5913A6: gdcm::FillDefaultVRDict(std::map<std::string,
std::string, std::less<std::string>, std::allocator<std::pair<std::string
const, std::string> > >&) (char_traits.h:258)
==22307==    by 0x58EC68: gdcm::VR::VR() (gdcmVR.cxx:47)
==22307==    by 0x56A3D4: gdcm::Global::Global() (gdcmGlobal.cxx:71)
==22307==    by 0x56B48E: _GLOBAL__I__ZN4gdcm12GDCM_UNKNOWNE
(gdcmGlobal.cxx:56)
==22307==    by 0x689B05: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307==    by 0x483992: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307== 
==22307== 
==22307== 353,305 bytes in 10,398 blocks are possibly lost in loss record
202 of 206
==22307==    at 0x4904F57: operator new(unsigned long)
(vg_replace_malloc.c:167)
==22307==    by 0x313E69024D: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (in
/usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E69260A: (within /usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x313E692722: std::string::string(char const*,
std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.3)
==22307==    by 0x58BC70: _GLOBAL__I__ZN4gdcm4Util8GDCM_UIDE
(new_allocator.h:62)
==22307==    by 0x689B05: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307==    by 0x483992: (within
/home/bwalsh/NeuRecon_source/test/ComputeSingleEigenValue)
==22307== 
==22307== 
==22307== 342,884,360 bytes in 1 blocks are possibly lost in loss record 205
of 206
==22307==    at 0x4905415: operator new[](unsigned long)
(vg_replace_malloc.c:199)
==22307==    by 0x4A91E8: itk::ImportImageContainer<unsigned long,
itk::FixedArray<float, 3> >::AllocateElements(unsigned long) const
(itkImportImageContainer.txx:176)
==22307==    by 0x4A94B8: itk::ImportImageContainer<unsigned long,
itk::FixedArray<float, 3> >::Reserve(unsigned long)
(itkImportImageContainer.txx:77)
==22307==    by 0x4A962E: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::AllocateOutputs() (itkSmartPointer.h:71)
==22307==    by 0x4A96CB:
itk::InPlaceImageFilter<itk::Image<itk::SymmetricSecondRankTensor<double,
3>, 3>, itk::Image<itk::FixedArray<float, 3>, 3> >::AllocateOutputs()
(itkInPlaceImageFilter.txx:106)
==22307==    by 0x4A3520: itk::ImageSource<itk::Image<itk::FixedArray<float,
3>, 3> >::GenerateData() (itkImageSource.txx:214)
==22307==    by 0x4C47EC:
itk::ProcessObject::UpdateOutputData(itk::DataObject*)
(itkProcessObject.cxx:991)
==22307==    by 0x4857B7: main (itkSmartPointer.h:71)
==22307== 
==22307== 
==22307== 1,371,537,416 bytes in 1 blocks are possibly lost in loss record
206 of 206
==22307==    at 0x4905415: operator new[](unsigned long)
(vg_replace_malloc.c:199)
==22307==    by 0x4B1058: itk::ImportImageContainer<unsigned long,
itk::SymmetricSecondRankTensor<double, 3> >::AllocateElements(unsigned long)
const (itkImportImageContainer.txx:176)
==22307==    by 0x4B1348: itk::ImportImageContainer<unsigned long,
itk::SymmetricSecondRankTensor<double, 3> >::Reserve(unsigned long)
(itkImportImageContainer.txx:77)
==22307==    by 0x4B2D34:
itk::HessianRecursiveGaussianImageFilter<itk::Image<float, 3>,
itk::Image<itk::SymmetricSecondRankTensor<double, 3>, 3> >::GenerateData()
(itkSmartPointer.h:71)
==22307==    by 0x4C47EC:
itk::ProcessObject::UpdateOutputData(itk::DataObject*)
(itkProcessObject.cxx:991)
==22307==    by 0x485755: main (itkSmartPointer.h:71)
==22307== 
==22307== LEAK SUMMARY:
==22307==    definitely lost: 216 bytes in 3 blocks.
==22307==      possibly lost: 1,714,796,844 bytes in 10,831 blocks.
==22307==    still reachable: 457,698,680 bytes in 3,164 blocks.
==22307==         suppressed: 0 bytes in 0 blocks.
==22307== Reachable blocks (those to which a pointer was found) are not
shown.
==22307== To see them, rerun with: --show-reachable=yes
Killed
-------------- next part --------------

// Software Guide : BeginCodeSnippet
#include "itkConnectedThresholdImageFilter.h"
// Software Guide : EndCodeSnippet


#include "itkImage.h"
#include "itkCastImageFilter.h"
#include "itkCurvatureFlowImageFilter.h"

#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
#include "itkHessianRecursiveGaussianImageFilter.h"
#include "itkImageAdaptor.h"
#include "PixelAccessors.h"
#include "itkSymmetricEigenAnalysisImageFilter.h"
#include "itkCastImageFilter.h"

#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"


int main( int argc, char *argv[])
{
  if( argc <4 )
    {
    std::cerr << "Missing Parameters " << std::endl;
    std::cerr << "Usage: " << argv[0];
    std::cerr << " inputImage sigma1 sigma2 sigma3" << std::endl;
	std::cerr << "with no mhd extension"<<std::endl;
    return 1;
    }

  typedef   unsigned short  InputPixelType;

  typedef   float           InternalPixelType;
  const     unsigned int    Dimension = 3;

  typedef itk::Image< InternalPixelType, Dimension >	InternalImageType;

  // We instantiate reader and writer types
  typedef   itk::ImageFileReader< InternalImageType >	ReaderType;
  typedef   itk::ImageFileWriter<  InternalImageType  > WriterType;

  
  typedef   itk::HessianRecursiveGaussianImageFilter< 
                            InternalImageType >           HessianFilterType;
  typedef   HessianFilterType::OutputImageType            HessianImageType;
  typedef   HessianImageType::PixelType                   HessianPixelType;

  typedef   itk::FixedArray< float, 3 >
 
EigenValueArrayType;
  typedef  itk::Image< EigenValueArrayType, HessianImageType::ImageDimension
>
 
EigenValueImageType;
  typedef  itk::ImageAdaptor<  EigenValueImageType, 
	
EigenValueAccessor< EigenValueArrayType > >	  ImageAdaptorType;
  typedef   itk::SymmetricEigenAnalysisImageFilter< 
	
HessianImageType, EigenValueImageType >     EigenAnalysisFilterType;
  typedef itk::CastImageFilter< ImageAdaptorType, 
	
InternalImageType >	  CastImageFilterType;

     const std::string mhd = ".mhd";
     const std::string sigmaString = ".Sigma";
 

     const std::string eigenValuesString1 = ".EigVal1";
     const std::string eigenValuesString2 = ".EigVal2";
     const std::string eigenValuesString3 = ".EigVal3";

	 const std::string inputVolumeFilename = argv[1];
	  std::string outputVolumeEigenValue_1_Filename =
inputVolumeFilename + eigenValuesString1 ;
	  std::string outputVolumeEigenValue_2_Filename =
inputVolumeFilename + eigenValuesString2 ;
	  std::string outputVolumeEigenValue_3_Filename =
inputVolumeFilename + eigenValuesString3 ;

	 itk::FixedArray< float, 3 >  sigmasValuesArray;

 
	sigmasValuesArray[0] = atof( argv[2] );
	sigmasValuesArray[1] = atof( argv[3] );
	sigmasValuesArray[2] = atof( argv[4] );

	 WriterType::Pointer m_InternalWriter = WriterType::New();
	  

	ReaderType::Pointer m_Reader =  ReaderType::New();
	m_Reader->SetFileName( (inputVolumeFilename+mhd).c_str());
    m_Reader->Update();

	HessianFilterType::Pointer  m_Hessian = HessianFilterType::New();
	m_Hessian->SetInput( m_Reader->GetOutput() );

  // Compute eigen values.. order them in ascending order
  EigenAnalysisFilterType::Pointer m_EigenFilter =
EigenAnalysisFilterType::New();
  m_EigenFilter->SetDimension( HessianPixelType::Dimension );

    // Create an adaptor and plug the output to the parametric space
  ImageAdaptorType::Pointer m_EigenAdaptor1 = ImageAdaptorType::New();
  EigenValueAccessor< EigenValueArrayType > accessor1;
  
  ImageAdaptorType::Pointer m_EigenAdaptor2 = ImageAdaptorType::New();
  EigenValueAccessor< EigenValueArrayType > accessor2;

  ImageAdaptorType::Pointer m_EigenAdaptor3 = ImageAdaptorType::New();
  EigenValueAccessor< EigenValueArrayType > accessor3;

  // m_EigenCastfilter1 will give the eigen values with the maximum eigen
  // value. m_EigenCastfilter3 will give the eigen values with the 
  // minimum eigen value.
   CastImageFilterType::Pointer m_EigenCastfilter1 =
CastImageFilterType::New();

  CastImageFilterType::Pointer m_EigenCastfilter2 =
CastImageFilterType::New();

  CastImageFilterType::Pointer m_EigenCastfilter3 =
CastImageFilterType::New();




  for(int i=0; i< sigmasValuesArray.Size(); i++)
  {
	 outputVolumeEigenValue_1_Filename =
outputVolumeEigenValue_1_Filename  + sigmaString + "." +  argv[i+2] + mhd;
     outputVolumeEigenValue_2_Filename = outputVolumeEigenValue_2_Filename
+ sigmaString + "." +  argv[i+2] + mhd;
     outputVolumeEigenValue_3_Filename = outputVolumeEigenValue_3_Filename
+ sigmaString + "." +  argv[i+2] + mhd;

	  std::cout<<"Computing hessian set to
"<<sigmasValuesArray[i]<<"..."<<std::endl;
		m_Hessian->SetSigma(sigmasValuesArray[i]);
		m_Hessian->Update();
	  std::cout<<"Computing hessian set to
"<<sigmasValuesArray[i]<<"...Done"<<std::endl;

	m_EigenFilter->SetInput( m_Hessian->GetOutput() );
	m_EigenFilter->OrderEigenValuesBy(
EigenAnalysisFilterType::FunctorType::OrderByValue );
	m_EigenFilter->Update();

	accessor1.SetEigenIdx( 0 );
	m_EigenAdaptor1->SetImage( m_EigenFilter->GetOutput() );
	m_EigenAdaptor1->SetPixelAccessor( accessor1 );

	accessor2.SetEigenIdx( 1 );
	m_EigenAdaptor2->SetImage( m_EigenFilter->GetOutput() );
	m_EigenAdaptor2->SetPixelAccessor( accessor2 );

    accessor3.SetEigenIdx( 2 );
	m_EigenAdaptor3->SetImage( m_EigenFilter->GetOutput() );
	m_EigenAdaptor3->SetPixelAccessor( accessor3 );

    m_EigenCastfilter1->SetInput( m_EigenAdaptor3 ); 
    m_EigenCastfilter2->SetInput( m_EigenAdaptor2 ); 
    m_EigenCastfilter3->SetInput( m_EigenAdaptor1 ); 

	std::cout<<"Writing EigenValues for
"<<sigmasValuesArray[i]<<"..."<<std::endl;
	m_EigenCastfilter1->Update();
	m_InternalWriter->SetInput( m_EigenCastfilter1->GetOutput() );
	m_InternalWriter->SetFileName(
outputVolumeEigenValue_1_Filename.c_str());
	m_InternalWriter->Update();

	m_EigenCastfilter2->Update();
	m_InternalWriter->SetInput( m_EigenCastfilter2->GetOutput() );
	m_InternalWriter->SetFileName(
outputVolumeEigenValue_2_Filename.c_str() );
	m_InternalWriter->Update();

	m_EigenCastfilter3->Update();
	m_InternalWriter->SetInput( m_EigenCastfilter3->GetOutput() );
	m_InternalWriter->SetFileName(
outputVolumeEigenValue_3_Filename.c_str());
	m_InternalWriter->Update();
	std::cout<<"Writing EigenValues for
"<<sigmasValuesArray[i]<<"...Done"<<std::endl;

	 outputVolumeEigenValue_1_Filename = inputVolumeFilename +
eigenValuesString1  ;
     outputVolumeEigenValue_2_Filename = inputVolumeFilename +
eigenValuesString2  ;
     outputVolumeEigenValue_3_Filename = inputVolumeFilename +
eigenValuesString3  ;
  }
 
 
  std::cout<<"Computing Eigenvalues... Done." << std::endl;
  return 0;
}





------------------------------

_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


End of Insight-users Digest, Vol 29, Issue 16
*********************************************




More information about the Insight-users mailing list