Skip to content

Commit

Permalink
Merge pull request #9 from melvingelbard/0.2
Browse files Browse the repository at this point in the history
Added 'Setting pixel size'
  • Loading branch information
petebankhead committed Jun 2, 2021
2 parents 61ed7dc + 593d829 commit d4a7f04
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/scripting/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,23 @@ If you have a selected object with a ``ROI`` in the image, you can also use that
`server.getPath()` may be renamed to `server.getID()` or similar in the future to reflect this.


Setting pixel size
==================

The following script sets the pixel size of the currently opened image:

.. code-block:: groovy
// Set pixel width and height to 0.5 microns
setPixelSizeMicrons(0.5, 0.5)
Z-spacing, alongside width and height, can also be set with the following script:

.. code-block:: groovy
// Set pixel width & height to 0.5 microns and Z-spacing to 1.0 micron
setPixelSizeMicrons(0.5, 0.5, 1.0)
Creating ROIs
=============

Expand Down
14 changes: 14 additions & 0 deletions docs/starting/first_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ You can also double-click the entry in the table to set it from a drop-down menu
QuPath can automatically estimate the image type for you, if you choose this option for *Set image type* in under :menuselection:`Edit --> Preferences...` |icon_cog|.
However, in case the estimate is wrong you should be aware the option exists - and should always be checked.

Setting the pixel size
----------------------

The pixel size is used extensively by QuPath. This is why it is good practice to make sure it's correct.

If stored in the image file, QuPath should automatically fetch the pixel size and display it under the **Image** tab ('Pixel width' & 'Pixel height').
If not, you can set the pixel size manually by double-clicking on either row and type the correct values.

.. Tip::
You can also set the pixel size based on a specific region of your image.
To do so, create an annotation around the region then double-click on either 'Pixel width' or 'Pixel height' under the **Image** tab to type its size in micron squared.

You can also draw a line annotation (if you want to make it perfectly horizontal or vertical, hold down the :kbd:`Shift` key) and do the same steps, typing the length in micron instead of the area.


Looking around
==============
Expand Down

0 comments on commit d4a7f04

Please sign in to comment.