<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Gaetan,<BR>
<BR>
Is there an example to show how to map spatial objects to an image? Examples/SpatialObjects/GaussianSpatialObject.cxx only creates the gaussian object, how is it possible to show it in an image?<BR>
<BR>> <BR>> <BR>> Hi,<BR>> <BR>> Have you tried to generate your image with some itk::GaussianSpatialObject <BR>> ?<BR>> <BR>> Regards,<BR>> <BR>> Gaetan<BR>> <BR>> On Mon, 08 Jan 2007 13:25:51 +0100, Christian Marshall Rieck <BR>> <rieck@stud.ntnu.no> wrote:<BR>> <BR>> >> Thanks for the reply, I am NOT avoiding the overlapping -- I just want<BR>> >> the particle-images to be overlapped naturally. That is, at each<BR>> >> overlapping region, the pixel values of one of the particle-images must<BR>> >> overwrite (NOT be added to) the pixel values of the other <BR>> >> particle-image.<BR>> >> Pasting does the job, however, it also overwrites the black background <BR>> >> of<BR>> >> each square-shaped particle-image (notice the square edges in the<BR>> >> overlapping areas in the sample<BR>> >> http://img81.imageshack.us/my.php?image=testyz7.png).<BR>> ><BR>> > In that case I dont know. Some guesses:<BR>> > *See if you can set the black border to a transparent color<BR>> > *Edit the pasting function to paste the pixels inside a cirle, leaving <BR>> > out<BR>> > the black corners/borders of the little images<BR>> > *As you are outputing PNG-files, can you create an int[][] and save<BR>> > this to a PNG-file in software outside ITK? There must be libraries for<BR>> > this. In this case you can have a function to return one of your little<BR>> > images/circles in a 10x10 matrix and specify which pixels should be <BR>> > copied<BR>> > to the array.<BR>> ><BR>> > Or you could wait until some of the nice people on this list with better<BR>> > programming skills than me answer your question :)<BR>> ><BR>> > chr.<BR>> ><BR>> ><BR>> >> > > I am trying to simulate an image like this:> > > > <BR>> >> http://ftp.sv.vt.edu/pub/projects97/pvlachos/pvlachos_project/images/piv.gif> <BR>> >> > > > I started with creating small sized GaussianImageSource instances <BR>> >> and pasting them at random positions on a background using <BR>> >> PasteImageFilter. The problem is when two GaussianImageSource overlap <BR>> >> as it can be seen in thios sample: <BR>> >> http://img81.imageshack.us/my.php?image=testyz7.png> > > > (2) If not, <BR>> >> how to get rid of the ovelaping problem?> > First thing that fell into <BR>> >> my head:> You could > instantiate an int/bool array[][] img with your <BR>> >> image size. Everytime you > paste to some location (x,y) you set <BR>> >> img[x][y] = 1/true. (also set all > pixels covered by this image). Next <BR>> >> time you want to paste to the image > check the pixels you are going to <BR>> >> paste into to se if there is an image > there alredy. If there is, <BR>> >> choose a new one.> > As the number of places a new image fits in the <BR>> >> larger image the > while(find_a_suitable_place) loop may take some <BR>> >> time. I am sure you can > come up with something clever to speed this <BR>> >> up.> > Example: > If your small images are 10x10 and you past to (0,0) <BR>> >> you set > img[0..10][0..10] = 1. > If you try to paste the next small <BR>> >> image to (2,2) (i guess you use a > random-function for this) you check <BR>> >> img[2..12][2..12]. Since these are not > 0 you must search for a new <BR>> >> location.> > Christian.><BR>> >> _________________________________________________________________<BR>> >> Be one of the first to try Windows Live Mail.<BR>> >> http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d<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>> http://voxel.jouy.inra.fr<BR><BR><br /><hr />Be one of the first to try <a href='http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d' target='_new'>Windows Live Mail.</a></body>
</html>