Re: Trim White Space and Unrotate?
Posted by EHB2010 on Mar 21, 2010; 3:19pm
URL: http://imagej.273.s1.nabble.com/Trim-White-Space-and-Unrotate-tp3688877p3688878.html
hi Kyle,
I'm afraid I don't have an extensive knowledge of all the plugins available so can't say if it already exists. I however have some experience of dealing with ROIs. I think you could solve this problem yourself quite simply by writing a plugin. I would approach it by drawing a line on the image and then turning the image so that is it vertical or whatever angle you wanted: for instance you could draw a line along the side of a rectangle and then the picture could be turned so that line is vertical. Or to compare one image to another you could draw a line on the first and then a line on the second and rotate the images so the lines have the same axis.
To get rid of white areas I would just calculate the margins by checking how many columns or rows at each edge are all completely white and then copy the image, excluding the white margins to a new image.
The methods provided in the ImageJ API would make that approach reasonably simple. There may of course be cleverer ways to go about it.
BW