[Insight-users] itk threads

Matt McCormick matt.mccormick at kitware.com
Thu Nov 15 23:47:00 EST 2012


Hi Cagatay,

Yes, if you need derivatives, then computing them in
BeforeThreadedGenerateData is a good idea.  If the derivative filters
that you use are multi-threaded, then you will take advantage of a
multi-core system.  Trying to do everything in ThreadedGenerateData
would actually hurt instead of help performance -- too many threads
will overload the system.

Matt

On Fri, Nov 16, 2012 at 2:15 AM, Cagatay Bilgin <bilgincc at gmail.com> wrote:
> Thank you for the prompt response Matt. If I understand correctly
> calculating all the derivatives in BeforeThreadedGenerateData and then
> implementing my measure in ThreadedGenerateData is the approach you are
> suggesting?
>
> Cagatay
>
> On Thu, Nov 15, 2012 at 11:52 AM, Matt McCormick
> <matt.mccormick at kitware.com> wrote:
>>
>> Hi Cagatay,
>>
>> It usually works better to compute ix, iy, iz, ixx, iyy, izz all in
>> one thread, and partition the data for each thread by ImageRegion.
>>
>> HTH,
>> Matt
>>
>> On Thu, Nov 15, 2012 at 7:43 PM, Cagatay Bilgin <bilgincc at gmail.com>
>> wrote:
>> > Lets say I am writing a filter that needs ix, iy, iz, ixx, iyy, izz to
>> > compute some measure. Once I have the output of derivatives, I know how
>> > to
>> > make my filter threaded. What I don't know is how to make use of threads
>> > to
>> > compute the derivatives in parallel, 1 thread computing ix, another one
>> > computing iy, another one ixx so and so forth. What would be the best
>> > ITK
>> > approach to do this? The derivative filters might already be threaded, I
>> > am
>> > using them just to illustrate the problem.
>> >
>> > I guess I can also set the requested region of the derivative filters in
>> > ThreadedGenerateData and then use the output of that to move on. Would
>> > that
>> > be the way to go?
>> >
>> > Cheers,
>> > Cagatay
>> >
>> > --
>> > Cemal Cagatay Bilgin
>> > Life Sciences Division
>> > Lawrence Berkeley National Lab
>> > MS977, One Cyclotron Road
>> > Berkeley, CA 94720, USA
>> > Email: ccbilgin at lbl.gov
>> >
>> > _____________________________________
>> > 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.php
>> >
>> > 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
>> >
>
>
>
>
> --
> Cemal Cagatay Bilgin
> Life Sciences Division
> Lawrence Berkeley National Lab
> MS977, One Cyclotron Road
> Berkeley, CA 94720, USA
> Email: ccbilgin at lbl.gov


More information about the Insight-users mailing list