Hi can anyone help me with this?
I'd like to do a profile plot that returns pixel intensities at equidistant sample points along a selection and I'd like to be able to specify the distance. Cheers R -- Dr Richard Mort MRC Human Genetics Unit Western General Hospital Crewe Road Edinburgh EH4 2XU, UK. Phone: +44 (0)131 332 2471 x 3205 Fax: +44 (0)131 467 8456 |
On Nov 14, 2008, at 9:30 AM, Richard Mort wrote:
> Hi can anyone help me with this? > I'd like to do a profile plot that returns pixel intensities at > equidistant sample points along a selection and I'd like to be able to > specify the distance. The Edit>Selection>Fit Spline command, when called with a ""straighten" option, converts a line selection to one with points spaced one pixel apart. Here is an example: newImage("Test", "8-bit Black", 480, 480, 1); makeLine(77,81,186,97,246,165,248,236,180,310,88,292); getSelectionCoordinates(x,y); print("points: ", x.length); run("Measure"); print("length: "+getResult("Length", nResults-1)); run("Fit Spline", "straighten"); getSelectionCoordinates(x,y); print("points: ", x.length); run("Measure"); print("length: "+getResult("Length", nResults-1)); -wayne |
I'm sorry I can't follow this please can you explain? I'd like to be
able to specify 'sample every n pixels' for any selection. Kind regards Richard Wayne Rasband wrote: > On Nov 14, 2008, at 9:30 AM, Richard Mort wrote: > >> Hi can anyone help me with this? >> I'd like to do a profile plot that returns pixel intensities at >> equidistant sample points along a selection and I'd like to be able to >> specify the distance. > > The Edit>Selection>Fit Spline command, when called with a ""straighten" > option, converts a line selection to one with points spaced one pixel > apart. Here is an example: > > newImage("Test", "8-bit Black", 480, 480, 1); > makeLine(77,81,186,97,246,165,248,236,180,310,88,292); > getSelectionCoordinates(x,y); > print("points: ", x.length); > run("Measure"); > print("length: "+getResult("Length", nResults-1)); > run("Fit Spline", "straighten"); > getSelectionCoordinates(x,y); > print("points: ", x.length); > run("Measure"); > print("length: "+getResult("Length", nResults-1)); > > -wayne -- Dr Richard Mort MRC Human Genetics Unit Western General Hospital Crewe Road Edinburgh EH4 2XU, UK. Phone: +44 (0)131 332 2471 x 3205 Fax: +44 (0)131 467 8456 |
If all you want to do is sample the image every n pixels, you can just just subsample the image
(menu Image->Scale... or Ctrl-E) and do a normal profile plot of a line on the resulting image. -- Harry Parker Senior Imaging Systems Engineer Digital Imaging Systems, Inc. ----- Original Message ---- From: Richard Mort <[hidden email]> To: [hidden email] Sent: Monday, November 17, 2008 4:30:31 AM Subject: Re: Pixel intensities at equidistant sample points along selection I'm sorry I can't follow this please can you explain? I'd like to be able to specify 'sample every n pixels' for any selection. Kind regards Richard Wayne Rasband wrote: > On Nov 14, 2008, at 9:30 AM, Richard Mort wrote: > >> Hi can anyone help me with this? >> I'd like to do a profile plot that returns pixel intensities at equidistant sample points along a selection and I'd like to be able to specify the distance. > > The Edit>Selection>Fit Spline command, when called with a ""straighten" option, converts a line selection to one with points spaced one pixel apart. Here is an example: > > newImage("Test", "8-bit Black", 480, 480, 1); > makeLine(77,81,186,97,246,165,248,236,180,310,88,292); > getSelectionCoordinates(x,y); > print("points: ", x.length); > run("Measure"); > print("length: "+getResult("Length", nResults-1)); > run("Fit Spline", "straighten"); > getSelectionCoordinates(x,y); > print("points: ", x.length); > run("Measure"); > print("length: "+getResult("Length", nResults-1)); > > -wayne -- Dr Richard Mort MRC Human Genetics Unit Western General Hospital Crewe Road Edinburgh EH4 2XU, UK. Phone: +44 (0)131 332 2471 x 3205 Fax: +44 (0)131 467 8456 |
Free forum by Nabble | Edit this page |