[Insight-users] (no subject)

Dan Mueller dan.muel at gmail.com
Fri Aug 6 05:57:09 EDT 2010


Hi Daniela,

Try adding brackets () to the GetOutput. That is, instead of
    filterCost->SetInput(filter->GetOutput);
try
    filterCost->SetInput( filter->GetOutput() );

You may need to brush up on C++ syntax before going further with ITK...

HTH

Cheers, Dan

On 6 August 2010 11:43, Daniela Sacchetto <danysunflower at hotmail.it> wrote:
> Thanks Sergio for your suggestions.
> I try to use the filter who suggested me but I have some problem and it
> doesn't run.
>
> I wrote this code:
> -------------------------------------------------------------------------------------------------------------------------------------------------
> typedef itk::AddConstantToImageFilter<InputImageType,const
> float,OutputImageType> AddCostantType;
>
> AddCostantType::Pointer filterCost= AddCostantType::New();
>
> filterCost->SetConstant(-0.5);
> filterCost->SetInput(filter->GetOutput);
>
> filterCost->Update();
> -----------------------------------------------------------------------------------------------------------------------------------
>
> But I have this output:
>
> /home/daniela/Scrivania/Skeleton_ok/DistanceTrasform/DistanceTrasform2.cxx:
> In function ‘int main(int, char**)’:
> /home/daniela/Scrivania/Skeleton_ok/DistanceTrasform/DistanceTrasform2.cxx:124:
> error: no matching function for call to
> ‘itk::AddConstantToImageFilter<itk::Image<signed char, 3u>, const float,
> itk::Image<short int, 3u> >::SetInput(<unresolved overloaded function
> type>)’
>
> [...]
>
> I included the itkAddConstantToImageFilter.h file in the same folder where I
> save my code (as I always do when I use header file not included in itk
> folder...).
> I thinks that I'm doing a stupid error, but I'm not expert in itk and c++,
> so I need your help.
>
> Thanks of all,
> Regards
> Daniela
> ________________________________
> Date: Fri, 6 Aug 2010 10:52:11 +0200
> Subject: Re: [Insight-users] (no subject)
> From: sergio.vera at alma3d.com
> To: danysunflower at hotmail.it
> CC: insight-users at itk.org
>
> Hi Daniela.
> Matlab and ITK are completely different environments... it may take a while
> to adapt.
> To substract 0.5 to a image you can use the following
> filter: itk::AddConstantToImageFilter
> to perform the comparation between the images you can
> use itk::DifferenceImageFilter
> regards
>
> On Fri, Aug 6, 2010 at 10:40 AM, Daniela Sacchetto
> <danysunflower at hotmail.it> wrote:
>
> Hi everyone,
> I'm working in itk and I have a problem.
>
> I have to do this operation :
> -----------------------------------------------------------------
> if (Daverage < (D - 0.5))        (*)
>       Dfinal=1
> else
>      Dfinal=0
> -----------------------------------------------------------------
> where:
>
> D= is a DistanceMap obtained with itkDanielssonDistanceMapImageFilter;
> Daverage = is D filtered with  itkDiscreteGaussianImageFilter;
>
> Dfinal = is a 3D map where pixel are black or white depending from (*).
>
> I'm trying to do it but I have several problems with operations/comparisons
> between images... Could anyone help me?
>
> For example in Matlab I can simply do:
>  D - 0.5
> to substract 0.5 to every pixel of my image... I tryed to do the same in itk
> but it doesn't run...
>
> Thanks all for help
> Daniela
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
> --
> Sergio Vera
>
>  Alma IT Systems
>  C/ Vilana, 4B, 4º 1ª
>  08022 Barcelona
>  T. (+34) 932 380 592
>  www.alma3d.com
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list