AW: FW: MRXS question
Martin Weihrauch
m.weihrauch at smartinmedia.com
Tue Sep 3 11:26:26 EDT 2024
Awesome, Angelos.
Thank you very much, I'll give it a try!
Best
Martin
-----Ursprüngliche Nachricht-----
Von: openslide-users <openslide-users-bounces+m.weihrauch=smartinmedia.com at lists.andrew.cmu.edu> Im Auftrag von Angelos Pappas
Gesendet: Dienstag, 3. September 2024 11:19
An: openslide-users at lists.andrew.cmu.edu
Betreff: RE: FW: MRXS question
Hello,
Even though I am not an OpenSlide user, here's how I calculate the width and the height of MRXS images so that it matches the Pannoramic Viewer:
First of all, calculate the bounds of image (i.e. min & max X & Y) by finding the left/right/top/bottom most tile that actually exists in the file. This means you have to loop through all the camera infos and check each tile if it exists and if it does, compare it against your current min / max x or y.
Then for max x & y add the tile width & height:
this.level0MaxX += level0.Info.TileWidth;
this.level0MaxY += level0.Info.TileHeight;
Finally do this rounding - I don't know it's purpose, I don't use it for any other calculation, it just matches what the Pannoramic viewer shows:
// this kind of rounding has been observed in the 3DHistech Pannoramic Viewer
this.level0MinX = Convert.ToInt32(Math.Floor(this.level0MinX / 256.0) * 256);
this.level0MinY = Convert.ToInt32(Math.Floor(this.level0MinY / 256.0) * 256);
this.level0MaxX = Convert.ToInt32(Math.Ceiling(this.level0MaxX / 256.0) * 256);
this.level0MaxY = Convert.ToInt32(Math.Ceiling(this.level0MaxY / 256.0) * 256);
level0.Width = this.level0MaxX - this.level0MinX;
level0.Height = this.level0MaxY - this.level0MinY;
Cheers
Angelos
> -----Original Message-----
> From: openslide-users <openslide-users-
> bounces+angelos=smartcode.gr at lists.andrew.cmu.edu> On Behalf Of
> Benjamin Gilbert
> Sent: Tuesday, September 3, 2024 12:20 AM
> To: openslide-users at lists.andrew.cmu.edu
> Subject: Re: FW: MRXS question
>
> On Mon, Sep 2, 2024 at 2:51 AM Martin Weihrauch
> <m.weihrauch at smartinmedia.com> wrote:
> > I had asked this question in July, but no one replied. Does anyone
> > know about this? If not, of course I will not ask again 😊
>
> Hi Martin,
>
> I don't think your question is answerable as written. Your own
> evidence shows that there is no consensus about how to calculate the
> size of level 0. :-)
>
> Best,
> --Benjamin Gilbert
> _______________________________________________
> openslide-users mailing list
> openslide-users at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
_______________________________________________
openslide-users mailing list
openslide-users at lists.andrew.cmu.edu
https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
More information about the openslide-users
mailing list