Pixels per unit for ndpi-images

Sample image and/or code

I can not share an image since the images are containing patient data. I can share my code:

find "$(pwd)" -iname "*.ndpi" -printf 'slideInfo is processing file [ %p ].\n' -exec /hpc/local/CentOS7/dhl_ec/software/slideToolKit/slideInfo -f "{}" \;

Which is using slideInfo as described here: slideToolKit/slideInfo at 04d23c142a845bccda49a17aacae354d9103872a · swvanderlaan/slideToolKit · GitHub.

For practical reasons slideToolKit currently works still with CellProfiler 2.2.0, however, that shouldn’t be the issue here.

cellprofiler --version

CellProfiler 2.2.0
Git ac0529e
Version 20160503183100
Built 2016-05-03T18:31:00

Background

The images are scanned using a Hamamatsu pathology scanner. Each slide contains a piece of an atherosclerotic plaque derived from the carotid artery. In this case we stained the tissue with alfa-actin 2 (SMA).

Analysis goals

I analysed the images using slideQuantify from slideToolKit/slideQuantify at 04d23c142a845bccda49a17aacae354d9103872a · swvanderlaan/slideToolKit · GitHub.

It uses a pipeLine (slideToolKit/SMA.V3.2.cppipe at 04d23c142a845bccda49a17aacae354d9103872a · swvanderlaan/slideToolKit · GitHub) to analyse the amount of positive SMA staining, and also to get a total tissue area. This should all be in pixels. However, I want to express the results in metric units, i.e. micrometers.

I was told the units per pixels are: 0.25 micrometer/pixel. However, I want to verify this. Therefore I used slideInfo as I figured this information should probably be in the image information.

Below is the output.

Challenges

I am looking for confirmation of my reasoning to figure out “what is the pixel per unit (or unit per pixel) based on the image information?”.

In the beginning of the image information it states:

tiff.ResolutionUnit: 'centimeter'
tiff.Software: 'NZAcquire 1.3.11.36'
tiff.XResolution: '43507'
tiff.YResolution: '43504'

At the first layer it states:

Image Width: 107520 Image Length: 66816
Resolution:  43504 pixels/cm

At the next layer it states:

Image Width: 26880 Image Length: 16704
Resolution:  10876 pixels/cm

My question

Am I correct in assuming that means there are always 43504 pixels per centimeter?

And therefore, 1/43504 equals 1 pixel per 0.00002298639206 centimeter, which equals 1 pixel per 0.2298639206000000212 micrometer. In other words, 1/0.2298639206000000212 = 4.350399999224584 pixels per micrometer.

It is quite a straightforward question, but since I cannot find a definitive answer from the Hamamatsu website, I just want to make sure through this forum.

slideInfo output

slideInfo MYIMAGE.ndpi

### openslide-show-properties (openslide) ###########################
hamamatsu.CCD.Height: '-1'
hamamatsu.CCD.Width: '5296'
hamamatsu.Calibration.Version: '500'
hamamatsu.Coarse.Focus.Pitch: '5000'
hamamatsu.Coarse.Focus.Travel: '10000'
hamamatsu.Condenser.NA: '0.50'
hamamatsu.Condition2.CCD.Height: '0'
hamamatsu.Condition2.CCD.Width: '0'
hamamatsu.Condition2.Lane.Shift.Amount: '0'
hamamatsu.Condition2.Objective.Lens.Magnificant: '1.01857e-312'
hamamatsu.Condition2.Stage.Offset: '0,0,0'
hamamatsu.Condition2.Vertical.Offset: '0,0'
hamamatsu.Created: '2020/04/10'
hamamatsu.Exposure.Barcode.Macro: '62'
hamamatsu.Exposure.CassetteBarcode: '81'
hamamatsu.Exposure.Slide.Darkfield.Macro: '-1'
hamamatsu.Exposure.Slide.Macro: '17'
hamamatsu.Fine.Focus.Pitch: '250'
hamamatsu.Fine.Focus.Travel: '400'
hamamatsu.FocalPlane.LeftBottom: '296613,243194,119053'
hamamatsu.FocalPlane.LeftTop: '296613,43194,119108'
hamamatsu.FocalPlane.RightBottom: '696613,243194,119763'
hamamatsu.FocalPlane.RightTop: '696613,43194,119806'
hamamatsu.IlluminationLevel.Barcode.Macro: '1000'
hamamatsu.IlluminationLevel.CassetteBarcode: '1000'
hamamatsu.IlluminationLevel.Slide.Darkfield.Macro: '-1'
hamamatsu.IlluminationLevel.Slide.Macro: '1800'
hamamatsu.Lane.Shift.Amount: '4'
hamamatsu.LightSource.ColorTemperature.Micro: '0'
hamamatsu.LightSource.Micro: '0,0'
hamamatsu.Macro.S/N: '000181'
hamamatsu.NDP.S/N: '000181'
hamamatsu.Objective.Lens.Magnificant: '20'
hamamatsu.PSHV.Gray8.Area.20x: '-1'
hamamatsu.PSHV.Gray8.Area.40x: '-1'
hamamatsu.PSHV.Gray8.Fine.40x: '-1'
hamamatsu.PSHV.Gray8.Rough.40x: '-1'
hamamatsu.PSHV.RGB24.20x: '2625'
hamamatsu.PSHV.RGB24.40x: '2625'
hamamatsu.PSHV.RGB24.Area.20x: '-1'
hamamatsu.PSHV.RGB24.Area.40x: '-1'
hamamatsu.PSHV.RGB24.Fine.20x: '-1'
hamamatsu.PSHV.RGB24.Rough.20x: '-1'
hamamatsu.Product: 'C13220'
hamamatsu.Property.Version: '2.0'
hamamatsu.ROI.Barcode.Macro: '1693,674,2318,1402'
hamamatsu.ROI.Slide.Macro: '155,669,2319,1400'
hamamatsu.Reference: 'AE3096.T12-13416.SMA.20140818'
hamamatsu.SourceLens: '40'
hamamatsu.Stage.Center: '386613,143194'
hamamatsu.Stage.Center.Fluorescence: '-1,-1'
hamamatsu.System.Version: '1..0'
hamamatsu.Target.White.Intensity: '235'
hamamatsu.Updated: '2020/09/21'
hamamatsu.Vertical.Offset: '0,0'
hamamatsu.XOffsetFromSlideCentre: '14227100'
hamamatsu.YOffsetFromSlideCentre: '-3708500'
openslide.level-count: '8'
openslide.level[0].downsample: '1'
openslide.level[0].height: '66816'
openslide.level[0].tile-height: '8'
openslide.level[0].tile-width: '3840'
openslide.level[0].width: '107520'
openslide.level[1].downsample: '2'
openslide.level[1].height: '33408'
openslide.level[1].tile-height: '4'
openslide.level[1].tile-width: '1920'
openslide.level[1].width: '53760'
openslide.level[2].downsample: '4'
openslide.level[2].height: '16704'
openslide.level[2].tile-height: '8'
openslide.level[2].tile-width: '960'
openslide.level[2].width: '26880'
openslide.level[3].downsample: '8'
openslide.level[3].height: '8352'
openslide.level[3].tile-height: '4'
openslide.level[3].tile-width: '480'
openslide.level[3].width: '13440'
openslide.level[4].downsample: '16'
openslide.level[4].height: '4176'
openslide.level[4].tile-height: '8'
openslide.level[4].tile-width: '240'
openslide.level[4].width: '6720'
openslide.level[5].downsample: '32'
openslide.level[5].height: '2088'
openslide.level[5].tile-height: '4'
openslide.level[5].tile-width: '120'
openslide.level[5].width: '3360'
openslide.level[6].downsample: '64'
openslide.level[6].height: '1044'
openslide.level[6].tile-height: '2'
openslide.level[6].tile-width: '60'
openslide.level[6].width: '1680'
openslide.level[7].downsample: '128'
openslide.level[7].height: '522'
openslide.level[7].tile-height: '1'
openslide.level[7].tile-width: '30'
openslide.level[7].width: '840'
openslide.mpp-x: '0.22984807042544877'
openslide.mpp-y: '0.22986392055902904'
openslide.objective-power: '40'
openslide.quickhash-1: '2e7b7f3ec82cd6191d77908ffa789ec7605aa050dd3773d8adae39fdb7d4d635'
openslide.vendor: 'hamamatsu'
tiff.DateTime: '2020:11:23 14:46:29'
tiff.Make: 'Hamamatsu'
tiff.Model: 'C13220'
tiff.ResolutionUnit: 'centimeter'
tiff.Software: 'NZAcquire 1.3.11.36'
tiff.XResolution: '43507'
tiff.YResolution: '43504'

### tiffinfo (libtiff) ##############################################
TIFF Directory at offset 0x16189b2b (370711339)
  Image Width: 107520 Image Length: 66816
  Resolution:  43504 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling:  1
  Samples/Pixel: 3
  Rows/Strip: 66816
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Make: Hamamatsu
  Model: C13220
  Software: NZAcquire 1.3.11.36
  DateTime: 2020:11:23 14:46:29
Created=2020/04/10
Updated=2020/09/21
Property.Version=2.0
Calibration.Version=500
Product=C13220
NDP.S/N=000181
Macro.S/N=000181
Objective.Lens.Magnificant=20
ROI.Slide.Macro=1400
ROI.Barcode.Macro=1402
Exposure.Slide.Macro=17
Exposure.Barcode.Macro=62
Exposure.Slide.Darkfield.Macro=-1
Exposure.CassetteBarcode=81
IlluminationLevel.Slide.Macro=1800
IlluminationLevel.Barcode.Macro=1000
IlluminationLevel.Slide.Darkfield.Macro=-1
IlluminationLevel.CassetteBarcode=1000
CCD.Width=5296
CCD.Height=-1
Coarse.Focus.Pitch=5000
Fine.Focus.Pitch=250
Lane.Shift.Amount=4
Vertical.Offset=0
Stage.Center=143194
FocalPlane.LeftTop=119108
FocalPlane.LeftBottom=119053
FocalPlane.RightTop=119806
FocalPlane.RightBottom=119763
Stage.Center.Fluorescence=--1
Coarse.Focus.Travel=10000
Fine.Focus.Travel=400
PSHV.RGB24.40x=2625
PSHV.RGB24.20x=2625
PSHV.RGB24.Rough.20x=-1
PSHV.RGB24.Fine.20x=-1
PSHV.RGB24.Area.40x=-1
PSHV.RGB24.Area.20x=-1
PSHV.Gray8.Rough.40x=-1
PSHV.Gray8.Fine.40x=-1
PSHV.Gray8.Area.40x=-1
PSHV.Gray8.Area.20x=-1
Target.White.Intensity=235
Condenser.NA=0.50
LightSource.Micro=0
LightSource.ColorTemperature.Micro=0
Condition2.Objective.Lens.Magnificant=1.01857e-312
Condition2.CCD.Width=0
Condition2.CCD.Height=0
Condition2.Lane.Shift.Amount=0
Condition2.Vertical.Offset=0
Condition2.Stage.Offset=0
,----------------------------------------------------------------0
TIFF Directory at offset 0x172d7466 (388854886)
  Image Width: 26880 Image Length: 16704
  Resolution:  10876 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling:  1
  Samples/Pixel: 3
  Rows/Strip: 16704
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Make: Hamamatsu
  Model: C13220
  Software: NZAcquire 1.3.11.36
  DateTime: 2020:11:23 14:46:29
Created=2020/04/10
Updated=2020/09/21
Property.Version=2.0
Calibration.Version=500
Product=C13220
NDP.S/N=000181
Macro.S/N=000181
Objective.Lens.Magnificant=20
ROI.Slide.Macro=1400
ROI.Barcode.Macro=1402
Exposure.Slide.Macro=17
Exposure.Barcode.Macro=62
Exposure.Slide.Darkfield.Macro=-1
Exposure.CassetteBarcode=81
IlluminationLevel.Slide.Macro=1800
IlluminationLevel.Barcode.Macro=1000
IlluminationLevel.Slide.Darkfield.Macro=-1
IlluminationLevel.CassetteBarcode=1000
CCD.Width=5296
CCD.Height=-1
Coarse.Focus.Pitch=5000
Fine.Focus.Pitch=250
Lane.Shift.Amount=4
Vertical.Offset=0
Stage.Center=143194
FocalPlane.LeftTop=119108
FocalPlane.LeftBottom=119053
FocalPlane.RightTop=119806
FocalPlane.RightBottom=119763
Stage.Center.Fluorescence=--1
Coarse.Focus.Travel=10000
Fine.Focus.Travel=400
PSHV.RGB24.40x=2625
PSHV.RGB24.20x=2625
PSHV.RGB24.Rough.20x=-1
PSHV.RGB24.Fine.20x=-1
PSHV.RGB24.Area.40x=-1
PSHV.RGB24.Area.20x=-1
PSHV.Gray8.Rough.40x=-1
PSHV.Gray8.Fine.40x=-1
PSHV.Gray8.Area.40x=-1
PSHV.Gray8.Area.20x=-1
Target.White.Intensity=235
Condenser.NA=0.50
LightSource.Micro=0
LightSource.ColorTemperature.Micro=0
Condition2.Objective.Lens.Magnificant=1.01857e-312
Condition2.CCD.Width=0
Condition2.CCD.Height=0
Condition2.Lane.Shift.Amount=0
Condition2.Vertical.Offset=0
Condition2.Stage.Offset=0
----------------------------------------------------------------------0
TIFF Directory at offset 0x17421a7e (390208126)
  Image Width: 6720 Image Length: 4176
  Resolution:  2719 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling:  1
  Samples/Pixel: 3
  Rows/Strip: 4176
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Make: Hamamatsu
  Model: C13220
  Software: NZAcquire 1.3.11.36
  DateTime: 2020:11:23 14:46:29
Created=2020/04/10
Updated=2020/09/21
Property.Version=2.0
Calibration.Version=500
Product=C13220
NDP.S/N=000181
Macro.S/N=000181
Objective.Lens.Magnificant=20
ROI.Slide.Macro=1400
ROI.Barcode.Macro=1402
Exposure.Slide.Macro=17
Exposure.Barcode.Macro=62
Exposure.Slide.Darkfield.Macro=-1
Exposure.CassetteBarcode=81
IlluminationLevel.Slide.Macro=1800
IlluminationLevel.Barcode.Macro=1000
IlluminationLevel.Slide.Darkfield.Macro=-1
IlluminationLevel.CassetteBarcode=1000
CCD.Width=5296
CCD.Height=-1
Coarse.Focus.Pitch=5000
Fine.Focus.Pitch=250
Lane.Shift.Amount=4
Vertical.Offset=0
Stage.Center=143194
FocalPlane.LeftTop=119108
FocalPlane.LeftBottom=119053
FocalPlane.RightTop=119806
FocalPlane.RightBottom=119763
Stage.Center.Fluorescence=--1
Coarse.Focus.Travel=10000
Fine.Focus.Travel=400
PSHV.RGB24.40x=2625
PSHV.RGB24.20x=2625
PSHV.RGB24.Rough.20x=-1
PSHV.RGB24.Fine.20x=-1
PSHV.RGB24.Area.40x=-1
PSHV.RGB24.Area.20x=-1
PSHV.Gray8.Rough.40x=-1
PSHV.Gray8.Fine.40x=-1
PSHV.Gray8.Area.40x=-1
PSHV.Gray8.Area.20x=-1
Target.White.Intensity=235
Condenser.NA=0.50
LightSource.Micro=0
LightSource.ColorTemperature.Micro=0
Condition2.Objective.Lens.Magnificant=1.01857e-312
Condition2.CCD.Width=0
Condition2.CCD.Height=0
Condition2.Lane.Shift.Amount=0
Condition2.Vertical.Offset=0
Condition2.Stage.Offset=0
,-------0
TIFF Directory at offset 0x1744c09c (390381724)
  Image Width: 2164 Image Length: 731
  Resolution:  292 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  Samples/Pixel: 3
  Rows/Strip: 731
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  Make: Hamamatsu
  Model: C13220
  Software: NZAcquire 1.3.11.36
  DateTime: 2020:11:23 14:46:29
Created=2020/04/10
Updated=2020/09/21
Property.Version=2.0
Calibration.Version=500
Product=C13220
NDP.S/N=000181
Macro.S/N=000181
Objective.Lens.Magnificant=20
ROI.Slide.Macro=1400
ROI.Barcode.Macro=1402
Exposure.Slide.Macro=17
Exposure.Barcode.Macro=62
Exposure.Slide.Darkfield.Macro=-1
Exposure.CassetteBarcode=81
IlluminationLevel.Slide.Macro=1800
IlluminationLevel.Barcode.Macro=1000
IlluminationLevel.Slide.Darkfield.Macro=-1
IlluminationLevel.CassetteBarcode=1000
CCD.Width=5296
CCD.Height=-1
Coarse.Focus.Pitch=5000
Fine.Focus.Pitch=250
Lane.Shift.Amount=4
Vertical.Offset=0
Stage.Center=143194
FocalPlane.LeftTop=119108
FocalPlane.LeftBottom=119053
FocalPlane.RightTop=119806
FocalPlane.RightBottom=119763
Stage.Center.Fluorescence=--1
Coarse.Focus.Travel=10000
Fine.Focus.Travel=400
PSHV.RGB24.40x=2625
PSHV.RGB24.20x=2625
PSHV.RGB24.Rough.20x=-1
PSHV.RGB24.Fine.20x=-1
PSHV.RGB24.Area.40x=-1
PSHV.RGB24.Area.20x=-1
PSHV.Gray8.Rough.40x=-1
PSHV.Gray8.Fine.40x=-1
PSHV.Gray8.Area.40x=-1
PSHV.Gray8.Area.20x=-1
Target.White.Intensity=235
Condenser.NA=0.50
LightSource.Micro=0
LightSource.ColorTemperature.Micro=0
Condition2.Objective.Lens.Magnificant=1.01857e-312
Condition2.CCD.Width=0
Condition2.CCD.Height=0
Condition2.Lane.Shift.Amount=0
Condition2.Vertical.Offset=0
Condition2.Stage.Offset=0
,0
TIFF Directory at offset 0x17469c76 (390503542)
  Image Width: 600 Image Length: 202
  Resolution:  80 pixels/cm
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 1
  Rows/Strip: 202
  Planar Configuration: single image plane
  Make: Hamamatsu
  Model: C13220
  Software: NZAcquire 1.3.11.36
  DateTime: 2020:11:23 14:46:29
Created=2020/04/10
Updated=2020/09/21
Property.Version=2.0
Calibration.Version=500
Product=C13220
NDP.S/N=000181
Macro.S/N=000181
Objective.Lens.Magnificant=20
ROI.Slide.Macro=1400
ROI.Barcode.Macro=1402
Exposure.Slide.Macro=17
Exposure.Barcode.Macro=62
Exposure.Slide.Darkfield.Macro=-1
Exposure.CassetteBarcode=81
IlluminationLevel.Slide.Macro=1800
IlluminationLevel.Barcode.Macro=1000
IlluminationLevel.Slide.Darkfield.Macro=-1
IlluminationLevel.CassetteBarcode=1000
CCD.Width=5296
CCD.Height=-1
Coarse.Focus.Pitch=5000
Fine.Focus.Pitch=250
Lane.Shift.Amount=4
Vertical.Offset=0
Stage.Center=143194
FocalPlane.LeftTop=119108
FocalPlane.LeftBottom=119053
FocalPlane.RightTop=119806
FocalPlane.RightBottom=119763
Stage.Center.Fluorescence=--1
Coarse.Focus.Travel=10000
Fine.Focus.Travel=400
PSHV.RGB24.40x=2625
PSHV.RGB24.20x=2625
PSHV.RGB24.Rough.20x=-1
PSHV.RGB24.Fine.20x=-1
PSHV.RGB24.Area.40x=-1
PSHV.RGB24.Area.20x=-1
PSHV.Gray8.Rough.40x=-1
PSHV.Gray8.Fine.40x=-1
PSHV.Gray8.Area.40x=-1
PSHV.Gray8.Area.20x=-1
Target.White.Intensity=235
Condenser.NA=0.50
LightSource.Micro=0
LightSource.ColorTemperature.Micro=0
Condition2.Objective.Lens.Magnificant=1.01857e-312
Condition2.CCD.Width=0
Condition2.CCD.Height=0
Condition2.Lane.Shift.Amount=0
Condition2.Vertical.Offset=0
Condition2.Stage.Offset=0

### identify (ImageMagick) ##########################################
/directory/MYIMAGE.ndpi[0] TIFF 107520x66816 107520x66816+0+0 8-bit sRGB 390.5MB 0.080u 0:00.099
/directory/MYIMAGE.ndpi[1] TIFF 26880x16704 26880x16704+0+0 8-bit sRGB 390.5MB 215.250u 3:35.269
/directory/MYIMAGE.ndpi[2] TIFF 6720x4176 6720x4176+0+0 8-bit sRGB 390.5MB 216.010u 3:36.030
/directory/MYIMAGE.ndpi[3] TIFF 2164x731 2164x731+0+0 8-bit sRGB 390.5MB 216.060u 3:36.079
/directory/MYIMAGE.ndpi[4] TIFF 600x202 600x202+0+0 8-bit sRGB 390.5MB 216.060u 3:36.079
identify: Auto-corrected former TIFF subsampling values [2,2] to match subsampling values inside JPEG compressed data [1,1]. `JPEGFixupTagsSubsamplingSec' @ warning/tiff.c/TIFFWarnings/891.
### file ##########################################
/directory/MYIMAGE.ndpi: TIFF image data, little-endian

On many scopes, if you are always using the same objective and camera, then you should be able to reliably say the pixel size is consistent; on others, if you can set ANY sort of a zoom parameter, you cannot. I would talk to your local rep if you’re not sure if you can set a zoom or not!