[Insight-users] (no subject)
Daniela Sacchetto
danysunflower at hotmail.it
Fri Aug 6 05:43:41 EDT 2010
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100806/e06e7790/attachment.htm>
More information about the Insight-users
mailing list