exchangeImage | R Documentation |
Exchanges the image and scales the coordinates of all
spatial aspects in the SPATA2
object accordingly.
exchangeImage(
object,
image,
img_scale_fct = 1,
adjust = TRUE,
verbose = NULL,
...
)
object |
An object of class |
image |
Image input or character value. If character, input is interpreted as a directory
to a file or to an URL and is read with If not character, the function ensures that the input is - or is convertible - to
class |
img_scale_fct |
Numeric value or |
adjust |
Logical value. If |
verbose |
Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
... |
Used to absorb deprecated arguments or functions. |
Using argument img_scale_fct
:
This argument can either be used to downscale very big images by a factor or it can be used to effectively multiply the resolution of the old image.
img_scale_fct
< 1: The scale factor is used to simply scale down the width and height of the
new image. E.g. width is 800px and height is 1000px and img_scale_fct = 0.5
. In this case,
the new image is stored with the dimensions width of 400px and height of 500px.
img_scale_fct
> 1: The scale factor is used to set the width and height in relation
to the old image. E.g. width and height of the old image are both 1000px and img_scale_fct = 1.5
the new image will be stored with the dimensions width = 1500px and height = 1500px - three
times as high of a resolution than the old image. If the basic resolution of the new image
is not bigger or equal than the required one an error is thrown. - Setting img_scale_fct
to a
value bigger than 1 only makes sense if the new image is bigger than the old one.
The function requires the SPATA2
object to already contain an
image. This is because images of different resolution (total number of pixels)
require the x- and y-coordinates to be scaled. The function assumes
that the coordinates are properly scaled to the old image. The scale factor with
which the coordinates are scaled to the new image is then computed by comparing the resolution
of the old image with the one from the new image.
Images are stored in form of the Image
class from the EBImage
package. To
be precise, they are stored in an S4 object of class HistologyImaging
altogether
with meta data.
rescaleImage()
to downscale the current image. createHistologyImaging()
to see
information on how to set up the container in which the image is stored. containsImage()
and containsHistologyImaging()
to read more information about the difference between
both.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.