[Insight-users] 2D mask apply to 3D image series

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Fri May 30 10:59:12 EDT 2008


Hi,

I think that using that contribution may lead to a cleaner approach,  
without even looking at the code :-)

The filter itk::SliceBySliceImageFilter is able to apply a filter (or  
a pipeline of filters) to all the slices of an image. In your case,  
you can simply make it apply a mask image filter on all the slices,  
with the same mask for all the slices. To do that, you give the 2D  
mask image as mask to a mask filter, and you give *one* 3D input image  
to the slice by slice filter. It will look to something like:

   maskFilter2D->SetInput2( maskImg2d );
   sliceBySliceFilter->SetFilter( maskFilter2D );
   sliceBySliceFilter->SetInput( img3D );

and that's all. img3D will be masked on all the slices with maskImg2D.

Regards,

Gaëtan


Le 30 mai 08 à 16:34, Luis Ibanez a écrit :

>
> Hi Suyang,
>
> There is no particular filter that comes to mind...
>
> My suggestion will be to use image iterators and
> intertwine the 2D loop with the 3D one.
>
> Another option is to do
>
>  - Extract image filter 3D -> 2D
>  - MaskImageFilter in 2D
>  - PastImage filter to put the slice back
>
> and set this inside a while loop.
>
>
> It is quite likely that there
> are better ways to do it...
>
>
> Perhaps looking at the code of the paper:
>
> "Slice by slice filtering with ITK
> by Gaetan Lehmann
> http://www.insight-journal.org/InsightJournalManager/view_reviews.php?back=search.php%3Ftexte%3Dslice&journalid=6&pubid=133
> http://hdl.handle.net/1926/368
>
> may lead to a cleaner approach.
>
>
>  Regards,
>
>
>      Luis
>
>
> ------------------
> Suyang Mei wrote:
>> Hi, all -
>>   a simple question -
>>   I have a 2D binary mask which is generated from  
>> AccumulateImageFilter of 3D image volumes, and now I want to apply  
>> this 2D mask to each of the 3D slices. Is there any ITK class  
>> performing this kind of task?
>>   Thanks a lot.
>> Suyang
>> ------------------------------------------------------------------------
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080530/5f258636/attachment.pgp>


More information about the Insight-users mailing list