<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&lt; TInputImage, TOutputImage, TFunction &gt;</div>
<div>so that it accepts 3 input images in the constructor, and then internally does what?<br><br>&nbsp;</div>
<div><span class="gmail_quote">2006/10/17, Gaëtan Lehmann &lt;<a href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</a>&gt;:</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>&lt;<a href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com
</a>&gt; a écrit:<br><br>&gt; aha i see...<br>&gt; Yes, of course i know this is simple, but starting simple is always the<br>&gt; way<br>&gt; to go :)<br><br>sure<br><br>&gt;<br>&gt; I think maybe you have misunderstood what i want to do. I dont want to
<br>&gt; make<br>&gt; a RGB image, i just want to combine 3 different binary mask images into a<br>&gt; single grayscale mask image with values 0,1,2,3 (0=background, 1=gm,<br>&gt; 2=wm,3=wm)<br>&gt; If i just manage this i can port it to vtk no problem.
<br>&gt; So i just wanted to create a composite filter to do this for me.<br>&gt; 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>&gt;<br>&gt; Many regards :)<br>&gt;<br>&gt;<br>&gt; 2006/10/17, Gaëtan Lehmann &lt;<a href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</a>&gt;:<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; Hi,<br>&gt;&gt;<br>&gt;&gt; Most of the time, the simple manipulation like this one can already be<br>&gt;&gt; done in ITK or VTK, so you shouldn't have to create a new filter to do<br>&gt;&gt; that :-)
<br>&gt;&gt; However, we are always pleased to see someone motivated to develop some<br>&gt;&gt; new features for the toolkit, especially if he/she want to contribute<br>&gt;&gt; that<br>&gt;&gt; code to the community. I'm pretty sure you'll find something useful to
<br>&gt;&gt; code soon :-)<br>&gt;&gt;<br>&gt;&gt; To combine your 3 images, you can use ComposeRGBImageFilter (1), which<br>&gt;&gt; takes 3 input images and give you a RGB image.<br>&gt;&gt; However, I'm not sure you can pass the rgb image directly to vtk
<br>&gt;&gt; (perhaps<br>&gt;&gt; something to code :-)). You'll have to pass the 3 binary images in vtk<br>&gt;&gt; with ImageToVTKImageFilter, and compose the color image in vtk.<br>&gt;&gt;<br>&gt;&gt; Gaetan<br>&gt;&gt;
<br>&gt;&gt; (1)<br>&gt;&gt; <a href="http://www.itk.org/Doxygen/html/classitk_1_1ComposeRGBImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1ComposeRGBImageFilter.html</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>
&gt;&gt; Le Tue, 17 Oct 2006 19:56:04 +0200, Prename Surname<br>&gt;&gt; &lt;<a href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com</a>&gt; a écrit:<br>&gt;&gt;<br>&gt;&gt; &gt; Hello.<br>&gt;&gt; &gt; I am beginning to feel a bit more at home in itk/vtk now. There are
<br>&gt;&gt; &gt; still a<br>&gt;&gt; &gt; zillion things to learn about it, but its getting a bit better. So<br>&gt;&gt; now i<br>&gt;&gt; &gt; have decided that i want to try and make my own filter to get more<br>&gt;&gt; &gt; acquainted with the whole pipeline approach.
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I have read chapter 13 in the itksoftwareguide, and i have thought<br>&gt;&gt; about<br>&gt;&gt; &gt; a<br>&gt;&gt; &gt; approach to make my filter. I was hoping some of you experts would
<br>&gt;&gt; tell<br>&gt;&gt; &gt; me<br>&gt;&gt; &gt; if i am completely off, or if my idea is okay.<br>&gt;&gt; &gt; My situation is this:<br>&gt;&gt; &gt; I have a greyscale volume consisting of 182 slices that are 182x218
<br>&gt;&gt; &gt; pixels<br>&gt;&gt; &gt; of a brain.<br>&gt;&gt; &gt; I have a mask of corresponding size with values 0 and 255 for the<br>&gt;&gt; &gt; positions<br>&gt;&gt; &gt; of greymatter<br>&gt;&gt; &gt; I have a mask of corresponding size with values 0 and 255 for the
<br>&gt;&gt; &gt; positions<br>&gt;&gt; &gt; of whitematter<br>&gt;&gt; &gt; I have a mask of corresponding size with values 0 and 255 for the<br>&gt;&gt; &gt; positions<br>&gt;&gt; &gt; of CSF(brainfluid)<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt; Basically i want my filter to combine the 3 masks to a single image,<br>&gt;&gt; so<br>&gt;&gt; &gt; that<br>&gt;&gt; &gt; i can visualize this image in vtk with different colors for<br>&gt;&gt; greymatter,
<br>&gt;&gt; &gt; whitematter and CSF.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Making a filter (lets call it masking)that subclasses<br>&gt;&gt; ImageToImageFilter,<br>&gt;&gt; &gt; and then takes 2 input images and somehow combining them to a single
<br>&gt;&gt; &gt; image<br>&gt;&gt; &gt; by just adding them together.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I then want to make a compositefilter that actually makes a pipeline<br>&gt;&gt; of<br>&gt;&gt; 2<br>&gt;&gt; &gt; masking filters, taking first 2 masks, combining them in the masking
<br>&gt;&gt; &gt; filter,<br>&gt;&gt; &gt; takes the output of this and combine it with the third mask using<br>&gt;&gt; again<br>&gt;&gt; &gt; the<br>&gt;&gt; &gt; masking filter, and then outputting the final masked image.
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Does this sound&nbsp;&nbsp;feasible, and more important is this a good approach?<br>&gt;&gt; &gt; I hope for some feedback.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Many regards and thank you<br>&gt;&gt;
<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; Gaëtan Lehmann<br>&gt;&gt; Biologie du Développement et de la Reproduction<br>&gt;&gt; INRA de Jouy-en-Josas (France)<br>&gt;&gt; tel: +33 1 34 65 29 66&nbsp;&nbsp;&nbsp;&nbsp;fax: 01 34 65 29 09
<br>&gt;&gt; <a href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</a><br>&gt;&gt;<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&nbsp;&nbsp;&nbsp;&nbsp;fax: 01 34 65 29 09
<br><a href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</a><br></blockquote></div><br>