Why is the SubBlock-Count different from the size of the list of sub-blocks?

Your place to discuss general handling of images and the CZI file format
Post Reply
user-6898
Posts: 5
Joined: Thu Jan 01, 1970 1:00 am

Why is the SubBlock-Count different from the size of the list of sub-blocks?

Post by user-6898 »

The output of

Code: Select all

CZIcmd.exe --command PrintInformation --source sample_image.czi
is

Code: Select all

SubBlock-Statistics
-------------------

SubBlock-Count: 3129

Bounding-Box:
 All:    X=-50400 Y=17279 W=36184 H=32577
 Layer0: X=-50394 Y=17279 W=36178 H=32510

M-Index: min=0 max=673

Bounds:
 C -> Start=0 Size=1
 S -> Start=0 Size=1
 B -> Start=0 Size=1

Bounding-Box for scenes:
 Scene0:
  All:    X=-50400 Y=17279 W=36184 H=32577
  Layer0: X=-50394 Y=17279 W=36178 H=32510
However, the output of

Code: Select all

CZIcmd.exe --info-level AllSubBlocks --command PrintInformation --source sample_image.czi
is

Code: Select all

#0: C0S0B0 M=1 logical=(-43202,17279,1600,1200) phys.=(1600,1200) pixeltype=bgr24 comp.mode=jpgxr
#1: C0S0B0 M=0 logical=(-44640,17280,1600,1200) phys.=(1600,1200) pixeltype=bgr24 comp.mode=jpgxr
#2: C0S0B0 M=2 logical=(-41760,17279,1600,1200) phys.=(1600,1200) pixeltype=bgr24 comp.mode=jpgxr
#3: C0S0B0 M=3 logical=(-40322,17279,1600,1200) phys.=(1600,1200) pixeltype=bgr24 comp.mode=jpgxr
...
#1040: C0S0B0 M=-2147483648 logical=(-50400,33664,16384,16144) phys.=(1024,1009) pixeltype=bgr24 comp.mode=jpgxr
#1041: C0S0B0 M=-2147483648 logical=(-50400,17280,36160,32576) phys.=(565,509) pixeltype=bgr24 comp.mode=jpgxr
#1042: C0S0B0 M=-2147483648 logical=(-50400,17280,32768,32544) phys.=(1024,1017) pixeltype=bgr24 comp.mode=jpgxr
which implies that there are 1043 sub-blocks.
So why is the value of SubBlock-Count 3129?
user-4
Posts: 398
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello nadukandi,

this value

SubBlock-Count: 3129

is wrong!

The bug fix has already been made and will be checked in on GitHub as

fix for faulty calculation of "SubBlockStatistics.subBlockCount"


Thank you for your contribution!
user-6898
Posts: 5
Joined: Thu Jan 01, 1970 1:00 am

Thank you for your kind reply and confirming that it was a bug.

Post by user-6898 »

As the SubBlock-Count of 3129 is the result of multiplying 3 to the total number of subblocks (1043), I assumed that the SubBlock-Count considers the pyramidal subblocks in R,G,B as distinct entities.
Thank you for your kind reply and confirming that it was a bug.
Post Reply