<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Hi guys,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm actually working on a similar filter and should have it finished in a couple of days (depending on how my cold progresses). Basically the image takes as input a vector of input images and produces a single image with the "interesting" voxels from the input images labeled. I can post the filter when finished.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-Robert</DIV><BR><DIV><DIV>On Oct 17, 2006, at 6:15 PM, Prename Surname wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV>Aha, that would of course also be an idea to do like that. I dont know any of these filters.</DIV> <DIV>So your interresting suggestion is to subclass the </DIV> <DIV>itk::NaryFunctorImageFilter< TInputImage, TOutputImage, TFunction ></DIV> <DIV>so that it accepts 3 input images in the constructor, and then internally does what?<BR><BR> </DIV> <DIV><SPAN class="gmail_quote">2006/10/17, Gaëtan Lehmann <<A href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</A>>:</SPAN> <BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Le Tue, 17 Oct 2006 21:18:16 +0200, Prename Surname<BR><<A href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com </A>> a écrit:<BR><BR>> aha i see...<BR>> Yes, of course i know this is simple, but starting simple is always the<BR>> way<BR>> to go :)<BR><BR>sure<BR><BR>><BR>> I think maybe you have misunderstood what i want to do. I dont want to <BR>> make<BR>> a RGB image, i just want to combine 3 different binary mask images into a<BR>> single grayscale mask image with values 0,1,2,3 (0=background, 1=gm,<BR>> 2=wm,3=wm)<BR>> If i just manage this i can port it to vtk no problem. <BR>> So i just wanted to create a composite filter to do this for me.<BR>> Do you see what i mean?<BR><BR>Yes, I think :-)<BR>This mean you are sure that the object in an image is never overlapping<BR>with the objects in the other images. Is it the case ? <BR>If yes, you can use ChangeLabelImageFilter to change the value of your<BR>background pixels to 0 (if it's not already the case), and the values of<BR>the foreground pixel to 1 in the first image, 2 in the second one, and 3 <BR>in the last one. Finally, you can add your 3 images with<BR>NaryAddImageFilter to produce the image you want.<BR>It can be quite boring to instantiate 4 filters to do that - perhaps<BR>that's the right time to implement a custom filter based on <BR>NaryFunctorImageFilter :-)<BR><BR>Gaetan<BR><BR>><BR>> Many regards :)<BR>><BR>><BR>> 2006/10/17, Gaëtan Lehmann <<A href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</A>>:<BR> >><BR>>><BR>>> Hi,<BR>>><BR>>> Most of the time, the simple manipulation like this one can already be<BR>>> done in ITK or VTK, so you shouldn't have to create a new filter to do<BR>>> that :-) <BR>>> However, we are always pleased to see someone motivated to develop some<BR>>> new features for the toolkit, especially if he/she want to contribute<BR>>> that<BR>>> code to the community. I'm pretty sure you'll find something useful to <BR>>> code soon :-)<BR>>><BR>>> To combine your 3 images, you can use ComposeRGBImageFilter (1), which<BR>>> takes 3 input images and give you a RGB image.<BR>>> However, I'm not sure you can pass the rgb image directly to vtk <BR>>> (perhaps<BR>>> something to code :-)). You'll have to pass the 3 binary images in vtk<BR>>> with ImageToVTKImageFilter, and compose the color image in vtk.<BR>>><BR>>> Gaetan<BR>>> <BR>>> (1)<BR>>> <A href="http://www.itk.org/Doxygen/html/classitk_1_1ComposeRGBImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1ComposeRGBImageFilter.html</A><BR>>><BR>>><BR>>><BR> >> Le Tue, 17 Oct 2006 19:56:04 +0200, Prename Surname<BR>>> <<A href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com</A>> a écrit:<BR>>><BR>>> > Hello.<BR>>> > I am beginning to feel a bit more at home in itk/vtk now. There are <BR>>> > still a<BR>>> > zillion things to learn about it, but its getting a bit better. So<BR>>> now i<BR>>> > have decided that i want to try and make my own filter to get more<BR>>> > acquainted with the whole pipeline approach. <BR>>> ><BR>>> > I have read chapter 13 in the itksoftwareguide, and i have thought<BR>>> about<BR>>> > a<BR>>> > approach to make my filter. I was hoping some of you experts would <BR>>> tell<BR>>> > me<BR>>> > if i am completely off, or if my idea is okay.<BR>>> > My situation is this:<BR>>> > I have a greyscale volume consisting of 182 slices that are 182x218 <BR>>> > pixels<BR>>> > of a brain.<BR>>> > I have a mask of corresponding size with values 0 and 255 for the<BR>>> > positions<BR>>> > of greymatter<BR>>> > I have a mask of corresponding size with values 0 and 255 for the <BR>>> > positions<BR>>> > of whitematter<BR>>> > I have a mask of corresponding size with values 0 and 255 for the<BR>>> > positions<BR>>> > of CSF(brainfluid)<BR>>> > <BR>>> > Basically i want my filter to combine the 3 masks to a single image,<BR>>> so<BR>>> > that<BR>>> > i can visualize this image in vtk with different colors for<BR>>> greymatter, <BR>>> > whitematter and CSF.<BR>>> ><BR>>> ><BR>>> > Making a filter (lets call it masking)that subclasses<BR>>> ImageToImageFilter,<BR>>> > and then takes 2 input images and somehow combining them to a single <BR>>> > image<BR>>> > by just adding them together.<BR>>> ><BR>>> > I then want to make a compositefilter that actually makes a pipeline<BR>>> of<BR>>> 2<BR>>> > masking filters, taking first 2 masks, combining them in the masking <BR>>> > filter,<BR>>> > takes the output of this and combine it with the third mask using<BR>>> again<BR>>> > the<BR>>> > masking filter, and then outputting the final masked image. <BR>>> ><BR>>> > Does this sound feasible, and more important is this a good approach?<BR>>> > I hope for some feedback.<BR>>> ><BR>>> > Many regards and thank you<BR>>> <BR>>><BR>>><BR>>> --<BR>>> Gaëtan Lehmann<BR>>> Biologie du Développement et de la Reproduction<BR>>> INRA de Jouy-en-Josas (France)<BR>>> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09 <BR>>> <A href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</A><BR>>><BR><BR><BR><BR>--<BR>Gaëtan Lehmann<BR>Biologie du Développement et de la Reproduction<BR>INRA de Jouy-en-Josas (France)<BR>tel: +33 1 34 65 29 66 fax: 01 34 65 29 09 <BR><A href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</A><BR></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Insight-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Insight-users@itk.org">Insight-users@itk.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>