Closed sunjiahe-hub closed 1 month ago
Hi @sunjiahe-hub,
Apologies for the slow reply. It looks like what your code is doing is finding the x coordinate start that an image is mapped to when using joinGiottoObjects()
with the default x padding value of 1000 between datasets. Then it applies that x coordinate as the x shift for the spatial locations and ensures that the y values are positive.
With Giotto 4.0.8, you can run ext(slice)
, where slice
is your giottoImage
or giottoLargeImage
object and that will return a SpatExtent
object which contains the final mapped xmin, xmax, ymin, ymax. You can run ext(slice)[][["xmin"]]
to directly get the add_to_x
value you calculate above.
I also wanted to mention that there are some spatial manipulation generics that you can use with spatLocsObj
(the Giotto subobject that encapsulates the spatial_locs information) spatShift()
can perform the x shift you apply to the coordinates and flip()
will flip the entire object across the x axis by default, which might be a safer alternative than abs()
for cases where the dataset coordinates straddle the x axis.
I also want to give a heads up that Giotto 4.0.8 is now using the @images
slot for both giottoImages
and giottoLargeImages
.
Best, George
Hello dear developers, Giotto is a very powerful tool. In version 3.3, I tried to write the function getNoshiftSpatialLocs to obtain the coordinate position of each slice in a multi-slice sample before it was translated; But in the latest version V4.0.5, the Giotto data structure has undergone major changes. I did not find the slice@minmax parameter, slice@minmax parameter, slice@boundaries parameter, etc. Where should I find them?
My purpose is to get the original coordinate position of each slice without translation.
The getNoshiftSpatialLocs function is as follows: