[Insight-users] error in building.. i think it's common?

Tim Bhatnagar tim.bhatnagar at gmail.com
Sat Jan 18 18:45:08 EST 2014


Thanks very much, Luis,

I've now got a nice-looking inverse deformation field, but I am having
trouble quantifying (extracting vector-field data) that matches my
qualitative observations.

Once I get the deformation field from the Demons registration, I can use
WarpImageFilter, with my 'moving' image data, and obtain a 'fixed' image
look-a-like. Great! I would like to quantitatively report the
transformation that takes the 'moving' image -> 'fixed' image, and I
believe I need the inverse transform to do that (can you confirm?)

I then am opening the *inverted* deformation field in Paraview and
exporting the vector values at each pixel (this data is used for a
validation method I have).

Does all of that seem straightforward? My qualitative data (the output of
the 'registered' image set looks really great!) and my quantitative
visualization of the deformation field in paraview do not seem to line up
as nicely as I had hoped.. could this simply be a result of the Demons reg.
and inverting a def-dield?

If the 'registered' output from the Demons routine looks VERY MUCH like my
'fixed' data set, can I not safely assume that the deformable registration
was a success?

Thanks again for your help,




On Sat, Jan 18, 2014 at 8:59 AM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

> Tim,
>
> That casting seems indeed to be the problem.
>
> When parsing the error message in the gist:
>
>  18 Reason:
>  19
>  20 cannot convert from '
>  21
>  22       itk::Vector<T,NVectorDimension>' to '
>  23 const itk::Vector<T,NVectorDimension>' 1> with
>  24
>  25 1> [ 1> T=double, 1> NVectorDimension=3 1> ] 1> and
>  26 1> [ 1> T=float,  1> NVectorDimension=3 1> ] 1>
>
> Note that, there are both:
>
> The "const" in the receiving variable (as Matt pointed out), and
> The difference between float and double.
>
> You may want to try this change:
>
>  23 //  typedef itk::Vector< float, Dimension >    VectorPixelType;
>  24   typedef itk::Vector< double, Dimension >    VectorPixelType;
>
> in   InvertDeformationField.cxx
>
>
>     Luis
>
>
>
>
> On Tue, Jan 14, 2014 at 2:24 PM, Tim Bhatnagar <tim.bhatnagar at gmail.com>wrote:
>
>> So.. in the main program, I just cast the vector-pixel quantities as
>> 'double' instead of 'float'... perhaps this is something that other
>> compilers can internally correct for?
>>
>> Please let me know if this slight (or at least, what I believe to be
>> 'slight') adjustment may cause any issues, post-build.
>>
>> Thanks to all that helped,
>>
>>
>> On Sun, Jan 12, 2014 at 8:39 AM, Tim Bhatnagar <tim.bhatnagar at gmail.com>wrote:
>>
>>> Hi Luis,, thanks for looking into that!
>>>
>>> Unfortunately, I'm still getting the same error about the const
>>> designation somewhere... In the gist, did you see the error output I
>>> included form ms visual c++? That's about as much as I can offer up in
>>> terms of understanding the error...
>>>
>>> Let me know if I can supply you with anything else, because I'd really
>>> appreciate the help!
>>>
>>> Thanks,
>>>
>>>
>>> On Saturday, January 11, 2014, Luis Ibanez wrote:
>>>
>>>> Tim,
>>>>
>>>> Thanks for sharing the code in the gist.
>>>>
>>>> I just downloaded it and compile it in Linux,
>>>> with no errors.
>>>>
>>>> Had you already fixed the problem ?
>>>> (maybe following Matt's advice ?)
>>>>
>>>>
>>>> Please let us know if we can still help,
>>>>
>>>>    Thanks
>>>>
>>>>           Luis
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Jan 7, 2014 at 12:12 PM, Tim Bhatnagar <tim.bhatnagar at gmail.com
>>>> > wrote:
>>>>
>>>> I've posted the cxx, txx and h-files associated with the program in
>>>> question, to a gist:
>>>>
>>>> https://gist.github.com/anonymous/8302651
>>>>
>>>> I'm certain this is a fairly trivial error (I hope!), but any direction
>>>> is much appreciated!
>>>>
>>>> Thanks,
>>>>
>>>> Tim
>>>>
>>>>
>>>> On Mon, Jan 6, 2014 at 3:44 PM, Matt McCormick <
>>>> matt.mccormick at kitware.com> wrote:
>>>>
>>>> Hi Tim,
>>>>
>>>> The error looks like it is related to const'ness instead of
>>>> SmartPointer from
>>>>
>>>>   'itk::Vector<T,
>>>> NVectorDimension>' to 'const itk::Vector<T,NVectorDimension> &'
>>>>
>>>> Hope this helps,
>>>> Matt
>>>>
>>>> On Mon, Jan 6, 2014 at 6:30 PM, Tim Bhatnagar <tim.bhatnagar at gmail.com>
>>>> wrote:
>>>> > Hi all,
>>>> >
>>>> > I am trying to build an Inverter for Deformation Fields that I
>>>> gathered from
>>>> > source code at:
>>>> >
>>>> > http://www.insight-journal.com/browse/publication/768
>>>> >
>>>> > The error I'm pasting below has something to do with using
>>>> smartpointers, I
>>>> > believe, but if anyone can point to the change I need to make, I'd be
>>>> very
>>>> > appreciative. Thanks!
>>>> >
>>>> > I am getting the following error when compiling in Visual Studio
>>>> Express
>>>> > 2010:
>>>> >
>>>> >
>>>> C:/ITKrap/InsightToolkit-4.2.0/Modules/Core/Common/include\itkFixedPointInverseDeformationFieldImageFilter.txx(109):
>>>> > error C2664: 'itk::ImageRegionIterator<TImage>::Set' : cannot convert
>>>> > parameter 1 from 'itk::Vector<T,NVectorDimension>' to 'const
>>>> > itk::Vector<T,NVectorDimension> &'
>>>> >           with
>>>> >           [
>>>> >               TImage=itk::Image<VectorPixelType,3>
>>>> >           ]
>>>> >           and
>>>> >           [
>>>> >               T=double,
>>>> >               NVectorDimension=3
>>>> >           ]
>>>> >           and
>>>> >           [
>>>> >               T=float,
>>>> >               NVectorDimension=3
>>>> >           ]
>>>> >           Reason: cannot convert from
>>>> 'itk::Vector<T,NVectorDimension>' to
>>>> > 'const itk::Vector<T,NVectorDimension>'
>>>> >           with
>>>> >           [
>>>> >               T=double,
>>>> >               NVectorDimension=3
>>>> >           ]
>>>> >           and
>>>> >           [
>>>> >               T=float,
>>>> >               NVectorDimension=3
>>>> >           ]
>>>> >           No user-defined-conversion operator available that can
>>>> perform
>>>> > this conversion, or the operator cannot be called
>>>> >
>>>> >
>>>> C:/ITKrap/InsightToolkit-4.2.0/Modules/Core/Common/include\itkFixedPointInverseDeformationFieldImageFilter.txx(51)
>>>> > : while compiling class template member function 'void
>>>> >
>>>> itk::FixedPointInverseDeformationFieldImageFilter<TInputImage,TOutputImage>::GenerateData(void)'
>>>> >           with
>>>> >           [
>>>> >               TInputImage=InputDFType,
>>>> >               TOutputImage=OutputDFType
>>>> >           ]
>>>> >
>>>> >
>>>> C:\ITKrap\DiffeomorphicDemons-2009-06-Vercauteren-IJSource\InvertDeformationField.cxx(50)
>>>> > : see reference to class template instantiation
>>>> >
>>>> 'itk::FixedPointInverseDeformationFieldImageFilter<TInputImage,TOutputImage>'
>>>> > being compiled
>>>> >           with
>>>> >           [
>>>> >               TInputImage=InputDFType,
>>>> >               TOutputImage=OutputDFType
>>>> >           ]
>>>> >
>>>> > --
>>>> > Tim Bhatnagar
>>>> > PhD Candidate
>>>> > Orthopaedic Injury Biomechanics Group
>>>> > Department of Mechanical Engineering
>>>> > University of British Columbia
>>>> >
>>>> > Rm 5000 - 818 West 10th Ave.
>>>> > Vancouver, BC
>>>> > Canada
>>>> > V5Z 1M9
>>>> >
>>>> > Ph: (604) 675-8845
>>>> > Fax:
>>>>
>>>>
>>>
>>> --
>>> Tim Bhatnagar
>>> PhD Candidate
>>> Orthopaedic Injury Biomechanics Group
>>> Department of Mechanical Engineering
>>> University of British Columbia
>>>
>>> Rm 5000 - 818 West 10th Ave.
>>> Vancouver, BC
>>> Canada
>>> V5Z 1M9
>>>
>>> Ph: (604) 675-8845
>>> Fax: (604) 675-8820
>>> Web: oibg.mech.ubc.ca
>>>
>>>
>>
>>
>> --
>> Tim Bhatnagar
>> PhD Candidate
>> Orthopaedic Injury Biomechanics Group
>> Department of Mechanical Engineering
>> University of British Columbia
>>
>> Rm 5000 - 818 West 10th Ave.
>> Vancouver, BC
>> Canada
>> V5Z 1M9
>>
>> Ph: (604) 675-8845
>> Fax: (604) 675-8820
>> Web: oibg.mech.ubc.ca
>>
>
>


-- 
Tim Bhatnagar
PhD Candidate
Orthopaedic Injury Biomechanics Group
Department of Mechanical Engineering
University of British Columbia

Rm 5000 - 818 West 10th Ave.
Vancouver, BC
Canada
V5Z 1M9

Ph: (604) 675-8845
Fax: (604) 675-8820
Web: oibg.mech.ubc.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140118/12481359/attachment.html>


More information about the Insight-users mailing list