[Insight-users] How to create a set of spatially distributed images

Ali - saveez at hotmail.com
Mon Jan 8 07:07:40 EST 2007


Chris,
 
Thanks for the reply, I am NOT avoiding the overlapping -- I just want the particle-images to be overlapped naturally. That is, at each overlapping region, the pixel values of one of the particle-images must overwrite (NOT be added to) the pixel values of the other particle-image. Pasting does the job, however, it also overwrites the black background of each square-shaped particle-image (notice the square edges in the overlapping areas in the sample http://img81.imageshack.us/my.php?image=testyz7.png).> > > I am trying to simulate an image like this:> > > > http://ftp.sv.vt.edu/pub/projects97/pvlachos/pvlachos_project/images/piv.gif> > > > I started with creating small sized GaussianImageSource instances and pasting them at random positions on a background using PasteImageFilter. The problem is when two GaussianImageSource overlap as it can be seen in thios sample: http://img81.imageshack.us/my.php?image=testyz7.png> > > > (2) If not, how to get rid of the ovelaping problem?> > First thing that fell into my head:> You could > instantiate an int/bool array[][] img with your image size. Everytime you > paste to some location (x,y) you set img[x][y] = 1/true. (also set all > pixels covered by this image). Next time you want to paste to the image > check the pixels you are going to paste into to se if there is an image > there alredy. If there is, choose a new one.> > As the number of places a new image fits in the larger image the > while(find_a_suitable_place) loop may take some time. I am sure you can > come up with something clever to speed this up.> > Example: > If your small images are 10x10 and you past to (0,0) you set > img[0..10][0..10] = 1. > If you try to paste the next small image to (2,2) (i guess you use a > random-function for this) you check img[2..12][2..12]. Since these are not > 0 you must search for a new location.> > Christian.> 
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070108/1ce19cb4/attachment.htm


More information about the Insight-users mailing list