Dan Mueller | 1 May 2010 06:56
Picon
Gravatar

Re: FastMarchingImageFilter extremely slow for a 3D image data

Hi Haiyong,

Thanks for letting us know your issue is solved.

Regarding the addition of the defines for Visual Studio: I am not
convinced adding these defines is a good solution. In your particular
case you wanted performance in debug mode, but another developer may
prefer to debug the iterators. I think the best solution is that
individual developers choose the best option for them. It is easy to
add these defines to you own project without needing them in the
toolkit itself.

Anyway, I am sure you will bump into this issue again in other parts
of the toolkit, not just in FastMarchingImageFilter. By its very
nature optimized release code will always run faster than
non-optimized debug code.

Cheers, Dan

On 30 April 2010 15:58, Haiyong Xu <haiyeong@...> wrote:
> Thanks Dan. It is the release/debug mode problem. I built it on the
> release mode and it finished within a second.
>
> Just wander why there is such huge difference between the release and
> debug mode for FastMarchingImageFilter. All my rest codes have no
> problem running in debug mode. And as a developer, I run my program in
> debug mode for thousands of times before release it. The
> FastMarchingImageFilter prevent me from debugging my program since it
> stuck whenever there is a call of fast_marching_filter->Update();
>
(Continue reading)

Dan Mueller | 1 May 2010 07:13
Picon
Gravatar

Re: How does the ImportFilter work ?

Hi Agnès,

itkImportImageFilter creates an image around the buffer provided to
the filter (ie. if you have the buffer in memory, no further memory is
allocated for the pixels).

If you then use the imported image in a processing pipeline, each
processing filter will -- typically -- create a new output image (ie.
allocate a new pixel buffer). Therefore the original imported buffer
is not changed. You can see this in itkImageSource (from which all
itkImageToImageFilters derive):

  /** The GenerateData method normally allocates the buffers for all of the
   * outputs of a filter. Some filters may want to override this default
   * behavior. For example, a filter may have multiple outputs with
   * varying resolution. Or a filter may want to process data in place by
   * grafting its input to its output. */
  virtual void AllocateOutputs();

This comment alludes to the solution:
Code/Common/itkInPlaceImageFilter. Running your processing operation
"in place" means that the output will be stored in the incoming pixel
buffer. To enable this feature you can call the following on any
filter which derives from itkInPlaceImageFilter:
    filter->InPlaceOn();

Unfortunately, not all processing operations can run in place (for
example, operations which change the image resolution, or pixel type).
Hopefully the processing operation you wish to perform derives from
itkInPlaceImageFilter...
(Continue reading)

Dan Mueller | 1 May 2010 07:18
Picon
Gravatar

Re: Following a straight line through an image

Hi Dirk,

You may be interested in the following post in the mailing list archives:
    http://www.itk.org/pipermail/insight-users/2010-March/036042.html

HTH

Cheers, Dan

On 30 April 2010 10:15, Dirk Boye <body@...> wrote:
> Dear list,
>
> I'd like to follow a straight line through an image.
> The starting point of the line is outside the image, the end point is
> somewhere inside.
> What I need to know are the pixel indeces the line passed
> and also the length of the line in each pixel. (this is very important)
>
> The image will have anisotropic spacing (like 0.7 x 0.7 x 4)
>
> Can i do this with itkPolyLineParametricPath?
> I couldn't find any example code for that.
>
>
> Thanks,
> Dirk
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
(Continue reading)

edoardo.belletti | 1 May 2010 11:18
Picon

ImageToPath

Hi
I have a question:There is a library that allows you to create an itk Polyline from a binary image where the line is given by the white pixels?
I do not know if I explained, I need to know if there is a library that do the opposite of PathToImageFilter.

Thank you very much
sorry for my bad explanation

Edoardo

_____________________________________
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
Dan Mueller | 1 May 2010 13:51
Picon
Gravatar

Re: ImageToPath

Hi Edoardo,

The following Insight Journal articles are capable of what you ask:

    Fast Marching Minimal Path Extraction in ITK
    http://www.insight-journal.org/browse/publication/213

    Implementation of weighted Dijkstra’s shortest-path algorithm for n-D images
    http://www.insight-journal.org/browse/publication/315

HTH

Cheers, Dan

On 1 May 2010 11:18,  <edoardo.belletti@...> wrote:
> Hi
> I have a question:There is a library that allows you to create an itk
> Polyline from a binary image where the line is given by the white pixels?
> I do not know if I explained, I need to know if there is a library that do
> the opposite of PathToImageFilter.
>
> Thank you very much
> sorry for my bad explanation
>
> Edoardo
>
> _____________________________________
> 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
>
>
_____________________________________
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

Karthik Krishnan | 1 May 2010 15:32
Favicon

Re: ImageToPath

A similar class also exists in VTK by the name vtkDijkstraImageGeodesicPath.

On 5/1/10, Dan Mueller <dan.muel@...> wrote:
> Hi Edoardo,
>
> The following Insight Journal articles are capable of what you ask:
>
>     Fast Marching Minimal Path Extraction in ITK
>     http://www.insight-journal.org/browse/publication/213
>
>     Implementation of weighted Dijkstra’s shortest-path algorithm for n-D
> images
>     http://www.insight-journal.org/browse/publication/315
>
> HTH
>
> Cheers, Dan
>
> On 1 May 2010 11:18,  <edoardo.belletti@...> wrote:
>> Hi
>> I have a question:There is a library that allows you to create an itk
>> Polyline from a binary image where the line is given by the white pixels?
>> I do not know if I explained, I need to know if there is a library that do
>> the opposite of PathToImageFilter.
>>
>> Thank you very much
>> sorry for my bad explanation
>>
>> Edoardo
>>
>> _____________________________________
>> 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
>>
>>
> _____________________________________
> 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
>

-- 
_________________________________
Karthik Krishnan
Kitware Inc.
Ph: +1 5188814919, +91 9538477060
_____________________________________
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

Christian Werner | 1 May 2010 18:03
Picon
Picon
Favicon

Object measuring with itkShapeLabelObject - Perimeter Calculation


Picon Picon Favicon
From: Christian Werner <christian.werner@...>
Subject: Object measuring with itkShapeLabelObject - Perimeter Calculation
Date: 2010-05-01 16:02:29 GMT
Hi!

I am using the nice labeling/measuring with the itkShapeLabelObject and 
CO. for quite a while in 3d. Now I did some measurement on 2d image 
data. I am somewhat surprised by the results. In particular I am not 
quite sure how the perimeter is calculated. I have attached a binary 
image and the results I get out of the corresponding ShapeLabelObjects. 
As for my knowledge, the circle should have a perimeter of 52 (counted 
all pixels that are in contact with the background - not diagonal ones).
Also, I am confused how the roundness can become greater than 1...? A 
hypersphere has the smallest possible perimeter for a given area, or am 
I somehow completely wrong here? The roundness is 
EquivalentPerimeter/Perimeter, isn't it? So it should always be between 
0.0 and 1.0. The sizes are correct though.

Maybe I am misusing everything somehow, but I couldn't find any bad 
code. The critical part is attached as well.

Best regards,
Christian
Attachment (code.cxx): text/x-c++src, 1532 bytes
_____________________________________
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
Christian Werner | 1 May 2010 23:14
Picon
Picon
Favicon

SubtractImageFilter - Modification

Hi!

I need a slightly modified version of the itkSubtractImageFilter that 
caps the result at 0, such that all negative values will become 0 
instead. I know I could do that with the actual SubtractImageFilter 
followed by a ShiftScaleImageFilter, but it is important that this is a 
one-pass filter since we are working with extremely large (up to 1GB) data.

I usually program in vtk and from time to time need some itk filters, so 
I don't have much clue about how to do that. Since this tiny little itzy 
bitzy special subtraction is the only thing I need and I don't have the 
time to really dive into "How to program ITK Filters that rock", I just 
looked at the code of the itkSubtractImageFilter. It seemed as if I 
could achieve what I want with changing a single line. I did that and 
replaced every occurence of "SubtractImageFilter" with 
"SubtractImageFilter2" (where the '2' denotes that this is a specially 
tailored, next-generation filter).

Then the time came to test out that new filter. I included it just like 
any other itk filter:

#include "itkSubtractImageFilter2.h".

The compiler had no problem with that (it finds this header). But when 
trying to instantiate a SubtractImageFilter2:

130 typedef itk::SubtractImageFilter2<ImageType, ImageType, ImageType> 
SubtractFilterType;
131 typename SubtractFilterType::Pointer subtractFilter = 
SubtractFilterType::New();

I get:

/home/christian/programming/pv-plugins/IO/vtkMeasureObjects.cxx:130: 
error: expected initializer before ‘<’ token
/home/christian/programming/pv-plugins/IO/vtkMeasureObjects.cxx:131: 
error: ‘SubtractFilterType’ has not been declared

which indicates that there is no SubtractImageFilter2. If I simply 
remove the "2" in the include and in line 130, everything is compiled 
just fine.

It seems more has to be done to announce a new itk Filter. I have 
attached the filter.

Any ideas?

Best regards,
Christian
_____________________________________
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
Christian Werner | 1 May 2010 23:22
Picon
Picon
Favicon

Re: SubtractImageFilter - Modification

Forget it. I had a typo. Maybe I just quit programming for today and 
finally take a rest... :)

Christian Werner wrote:
> Hi!
>
> I need a slightly modified version of the itkSubtractImageFilter that 
> caps the result at 0, such that all negative values will become 0 
> instead. I know I could do that with the actual SubtractImageFilter 
> followed by a ShiftScaleImageFilter, but it is important that this is 
> a one-pass filter since we are working with extremely large (up to 
> 1GB) data.
>
> I usually program in vtk and from time to time need some itk filters, 
> so I don't have much clue about how to do that. Since this tiny little 
> itzy bitzy special subtraction is the only thing I need and I don't 
> have the time to really dive into "How to program ITK Filters that 
> rock", I just looked at the code of the itkSubtractImageFilter. It 
> seemed as if I could achieve what I want with changing a single line. 
> I did that and replaced every occurence of "SubtractImageFilter" with 
> "SubtractImageFilter2" (where the '2' denotes that this is a specially 
> tailored, next-generation filter).
>
> Then the time came to test out that new filter. I included it just 
> like any other itk filter:
>
> #include "itkSubtractImageFilter2.h".
>
> The compiler had no problem with that (it finds this header). But when 
> trying to instantiate a SubtractImageFilter2:
>
> 130 typedef itk::SubtractImageFilter2<ImageType, ImageType, ImageType> 
> SubtractFilterType;
> 131 typename SubtractFilterType::Pointer subtractFilter = 
> SubtractFilterType::New();
>
> I get:
>
> /home/christian/programming/pv-plugins/IO/vtkMeasureObjects.cxx:130: 
> error: expected initializer before ‘<’ token
> /home/christian/programming/pv-plugins/IO/vtkMeasureObjects.cxx:131: 
> error: ‘SubtractFilterType’ has not been declared
>
> which indicates that there is no SubtractImageFilter2. If I simply 
> remove the "2" in the include and in line 130, everything is compiled 
> just fine.
>
> It seems more has to be done to announce a new itk Filter. I have 
> attached the filter.
>
> Any ideas?
>
>
> Best regards,
> Christian
> ------------------------------------------------------------------------
>
> _____________________________________
> 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

_____________________________________
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

elhadj meljane | 2 May 2010 17:34
Picon

Re: Demons registration stopping criteria

Dear Luke,
sorry I don't have an answer for your question, hope that you solved it or someone will help ...
But I have a question related ...
I try to use  itkFiniteDifferenceImageFilter to iterate with
f_{n+1} = f_n +dt*A_n
and I dont know how to introduce the A_n in this filter, I guess is done with ?
FiniteDifferenceImageFilter<..>::GenerateData()
{
...
this->ApplyUpdate()
...
}
 
is there an itk simple example of an implemntation of the ApplyUpdate() and how to use it to iterate with this filter.
 
Thanks,
Elhadj,

On Fri, Apr 30, 2010 at 5:45 PM, Luke Bloy <luke.bloy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'm curious about the stopping criteria used in the demons based registrations.

From looking at itkFiniteDifferenceImageFilter::Halt() it seems that the stopping criteria are one of either 2 things.
  1) the number of iterations exceeds some maximum.
  2) the RMS_change is less then some MaximumRMSError.

In the demons algorithm the RMS_change is defined as the average of the length of the update displacement field. Which seems to never decrease significantly.

Am I correct that there is no stopping criteria based on the image similarity metric? If not what would be the most sensible way/place to add such a criteria? Is there any interest in having this functionality?

thanks,
Luke



_____________________________________
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

_____________________________________
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

Gmane