Login  Register

Re: Splitting single image in four

Posted by Krs5 on Jul 01, 2016; 4:59pm
URL: http://imagej.273.s1.nabble.com/Splitting-single-image-in-four-tp5016797p5016798.html

Dear akp19

The macro code below is doing what you want.

title = getTitle();
w = getWidth();
h = getHeight();
makeRectangle(0, 0, 0.5*w, 0.5*h);
run("Duplicate...", " ");
selectWindow(title);
makeRectangle((0.5*w), 0, 0.5*w, 0.5*h);
run("Duplicate...", " ");
selectWindow(title);
makeRectangle(0, (0.5*h), 0.5*w, 0.5*h);
run("Duplicate...", " ");
selectWindow(title);
makeRectangle((0.5*w), (0.5*h), 0.5*w, 0.5*h);
run("Duplicate...", " ");
selectWindow(title);
close();

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of akp19
Sent: 01 July 2016 16:54
To: [hidden email]
Subject: Splitting single image in four

Hi!
I am quite new to ImageJ and not able to perform a relative simple task. I need to split a single image into 4 sub-images. Eg. a 1000*1000 image into four 250*250 images. How do I go about this? Will appreciate any help! Thank you!



--
View this message in context: http://imagej.1557.x6.nabble.com/Splitting-single-image-in-four-tp5016797.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html