Jpeg2000 in osimis viewer

163 views
Skip to first unread message

Sriram

unread,
Jul 22, 2020, 3:16:12 PM7/22/20
to Orthanc Users
Hi,

My Orthanc is configured with StorageCompression:true
I wish to know the internal steps involved in viewing this image in osimis viewer over the internet 

Q1. since the file is compressed using zlib due to StorageCompression:true, at the server will the osimis plugin/orthanc_server serve the file as it is or will it decompress and recompress while sending http data? I wish to understand the CPU/discIO costs

Q2, I took a 527kb raw dcm file, zipping it reduced the file to 264kb, which is about 50% compression. And jpeg2000 compression resulted in 221kb, thats about 58% compression. Difference of only 8. So is just StorageCompression:true good enough for most purposes? Or will using Jpeg2000 make a significant difference in disc/network cost? 

Q3, Is there any plan to support an option like Jpeg2000StorageCompression :)

Q4. Is jpeg2000 decompression natively supported across windows/mac/ipad/android platforms and across browsers? 

Q5. If StorageCompression is set to false and if images are stored in jpeg2000 TS itself, will osimis plugin serve the image as it is? 


Thanks

Alain Mazy

unread,
Jul 23, 2020, 9:26:05 AM7/23/20
to Sriram, Orthanc Users

Hi,

On Wed, Jul 22, 2020 at 9:16 PM Sriram <rampra...@gmail.com> wrote:
Hi,

My Orthanc is configured with StorageCompression:true
I wish to know the internal steps involved in viewing this image in osimis viewer over the internet 

Q1. since the file is compressed using zlib due to StorageCompression:true, at the server will the osimis plugin/orthanc_server serve the file as it is or will it decompress and recompress while sending http data? I wish to understand the CPU/discIO costs

Files are decompressed from disk to RAM before the plugin can use them.
 

Q2, I took a 527kb raw dcm file, zipping it reduced the file to 264kb, which is about 50% compression. And jpeg2000 compression resulted in 221kb, thats about 58% compression. Difference of only 8. So is just StorageCompression:true good enough for most purposes? Or will using Jpeg2000 make a significant difference in disc/network cost? 

numbers speak for themselves... 

Q3, Is there any plan to support an option like Jpeg2000StorageCompression :)

You can use StorageCompression and JPEG2000 but zipping JPEG2000 files would not bring any further compression.


Q4. Is jpeg2000 decompression natively supported across windows/mac/ipad/android platforms and across browsers? 


No, the JPEG2000 files need to be decompressed and re-compressed to JPG before the browser can decompress them.   JPEG2000 decompression is very slow so it's really not an optimal performance.  RAW files are encoded into JPEG or PNG before being sent to the browser to reduce the bandwidth but PNG compression is very slow.

The best storage/speed compromise we've found so far is by using JPEG transfer syntax (lossless).  With this TS, the files can be transferred as such to the browser that is able to decompress them.

Q5. If StorageCompression is set to false and if images are stored in jpeg2000 TS itself, will osimis plugin serve the image as it is? 


See above. 

Thanks

--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/3635ae65-86de-4084-bdc2-41bac5569f6bn%40googlegroups.com.


--

Alain Mazy / Orthanc-Studio Manager & Software Developer
a...@osimis.io / +32 494 31 67 27

Osimis

OSIMIS S.A. 
Quai Banning 6BE-4000 Liège 
www.osimis.io

Twitter LinkedIn


Sriram

unread,
Jul 24, 2020, 2:01:49 AM7/24/20
to Orthanc Users
Thanks Alain,


No, the JPEG2000 files need to be decompressed and re-compressed to JPG before the browser can decompress them.   JPEG2000 decompression is very slow so it's really not an optimal performance.  RAW files are encoded into JPEG or PNG before being sent to the browser to reduce the bandwidth but PNG compression is very slow.

Is that JPEG/PNG compression lossy or lossless?
Is there an option to disable PNG since compression is slow?
 

The best storage/speed compromise we've found so far is by using JPEG transfer syntax (lossless).  With this TS, the files can be transferred as such to the browser that is able to decompress them.

With some effort I can C-STORE the image in JPEG-LS format, but is there any built-in option to make Orthanc store the image in JPEG-LS?

Thanks
 

Alain Mazy

unread,
Jul 24, 2020, 11:46:51 AM7/24/20
to Sriram, Orthanc Users
On Fri, Jul 24, 2020 at 8:01 AM Sriram <rampra...@gmail.com> wrote:
Thanks Alain,


No, the JPEG2000 files need to be decompressed and re-compressed to JPG before the browser can decompress them.   JPEG2000 decompression is very slow so it's really not an optimal performance.  RAW files are encoded into JPEG or PNG before being sent to the browser to reduce the bandwidth but PNG compression is very slow.

Is that JPEG/PNG compression lossy or lossless?

Lossless
 
Is there an option to disable PNG since compression is slow?
 

No
 

The best storage/speed compromise we've found so far is by using JPEG transfer syntax (lossless).  With this TS, the files can be transferred as such to the browser that is able to decompress them.

With some effort I can C-STORE the image in JPEG-LS format, but is there any built-in option to make Orthanc store the image in JPEG-LS?



Note that JPEG-LS will also be slower than JPEG (1.2.840.10008.1.2.4.70)

FYI, here's a speed comparison we've recently performed:

MR study of 3x3 instances

J2KRAWJPEGLSJPEG
orthanc-instance-cache:8042Size in MB1.2404.5271.2531.674

Avg time for HQ image [s]0.2370.1160.1350.025

CR study of 3x3 instances

J2KRAWJPEGLSJPEG

orthanc-instance-cache:8042Size in MB51.701143.68352.44256.283

Avg time for HQ image [s]18.32010.38311.2611.210




 
Thanks
 

--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.

Sriram

unread,
Jul 26, 2020, 3:00:12 AM7/26/20
to Orthanc Users
Awesome.
"IngestTranscoding" : "1.2.840.10008.1.2.4.70" is precisely what I was looking for.

God Bless!

Sébastien Jodogne

unread,
Aug 1, 2020, 7:02:52 AM8/1/20
to Orthanc Users
Hello,

Just a complement of information on this topic:
 
No, the JPEG2000 files need to be decompressed and re-compressed to JPG before the browser can decompress them.   JPEG2000 decompression is very slow so it's really not an optimal performance.  RAW files are encoded into JPEG or PNG before being sent to the browser to reduce the bandwidth but PNG compression is very slow.

Is that JPEG/PNG compression lossy or lossless?
Is there an option to disable PNG since compression is slow?

JPEG is lossy (destructive compression).

PNG is lossless (non-destructive compression).

To replace the default PNG by JPEG when rendering images using the REST API of Orthanc, you can use the "Accept" HTTP header. For instance:

=> PNG image
=> JPEG image

Sébastien-
Reply all
Reply to author
Forward
0 new messages