cnr-isti-vclab / openlime

Web-based, advanced images viewer (RTI, multispectral, BRDF, etc. )
GNU General Public License v3.0
23 stars 6 forks source link

Add IIP Support to OpenLime #47

Closed ruven closed 2 months ago

ruven commented 3 months ago

These commits add IIPImage support to OpenLime, including support for TIFF stacks for RTI data. The implementation works for both image and RTI image types. An optional server parameter can be used to allow an iipsrv endpoint to be specified, in which case the url parameter is simply the image file name. Examples have been added to dist/examples.

An update to the scale bar code also adds µm units and allows the resolution to be obtained directly from the image layer.

ponchio commented 2 months ago

Looks fine except for a small detail: layers can be assigned a transformation inside the canvas, so the layer pixelSize cannot be directly used for the ScaleBar.

I think a cleaner solution could be to define a Layer function pixelSizeInMM() that keeps the layer transform into account (just need to be multiplied by the zoom parameter).

ruven commented 2 months ago

OK, so something like this within Layer.js?

function pixelSizeInMM(){
  return this.pixelSize * this.transform.z;
}

I guess pixelSize would also need to be initialized to zero within Layer.js via init(). Otherwise, we'd need to add an if (this.pixelSize) here.

ponchio commented 2 months ago

Looks fine, and yes, initializing makes more sense.

ponchio commented 2 months ago

Thanks!