Bug 163

Summary: Failure to recognize MIRAX / 3DHISTECH images
Product: Orthanc Reporter: Sébastien Jodogne <s.jodogne>
Component: Whole-slide imagingAssignee: Sébastien Jodogne <s.jodogne>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   

Description Sébastien Jodogne 2020-06-29 15:16:24 CEST
[BitBucket user: Alvaro Gonzalez]
[BitBucket date: 2019-12-27.11:15:02]

MIRAX slide format is multi file \([quite a nightmare](https://openslide.org/formats/mirax/)\). It contains a .mrxs file, which is the thumbnail in jpeg, then a folder with the same name that contains twenty-something files with the image and some data files, like this:

```
$ tree
.
├── SAMPLE
│   ├── Data0000.dat
│   ├── Data0001.dat
│   ├── Data0002.dat
│   ├── Data0003.dat
[...]
│   ├── Data0023.dat
│   ├── Data0024.dat
│   ├── Index.dat
│   └── Slidedat.ini
└── SAMPLE.mrxs
```



With Opensilde\+VIPS or openslide-show-properties, I can point to the .mrxs file, by the extension will know ist’s a MIRAX file, and it will scan the folder with the same name.

```
$ time vips openslideload SAMPLE.mrxs "slide.tiff[tile,tile-width=1024,tile-height=1024,compression=jpeg]"
vips openslideload SAMPLE.mrxs   426.53s user 28.85s system 311% cpu 2:26.00 total
$ identify slide.tiff 
slide.tiff TIFF 92168x210836 92168x210836+0+0 8-bit sRGB 972.404MiB 0.000u 0:00.000
```



But, with OrthancWSIDicomizer, it will detect it’s a JPEG file, and will just convert the thumbnail, ignoring the folder:

```shell
$ OrthancWSIDicomizer --openslide libopenslide.so.0 --folder test ./SAMPLE.mrxs
W1227 12:03:55.204598 FromDcmtkBridge.cpp:148] Loading the external DICOM dictionary "/usr/share/libdcmtk14/dicom.dic"
W1227 12:03:55.210985 ApplicationToolbox.cpp:248] Orthanc WSI version: 0.6
W1227 12:03:55.215870 HttpClient.cpp:739] No certificates are provided to validate peers, set "HttpsCACertificates" if you need to do HTTPS requests
W1227 12:03:55.215892 Dicomizer.cpp:870] The input image is: ./SAMPLE.mrxs
W1227 12:03:55.215948 Dicomizer.cpp:873] File format of the input image: JPEG
W1227 12:03:55.220658 Dicomizer.cpp:950] Compression of the individual source tiles: Unknown
W1227 12:03:55.221726 Dicomizer.cpp:167] Size of source tiles: 512x512
W1227 12:03:55.221741 Dicomizer.cpp:168] Pixel format: RGB24
W1227 12:03:55.221745 Dicomizer.cpp:169] Smoothing is disabled
W1227 12:03:55.221749 Dicomizer.cpp:180] No repainting of the background
W1227 12:03:55.221752 Dicomizer.cpp:192] Size of target tiles: 512x512
W1227 12:03:55.221757 Dicomizer.cpp:196] Target image compression: Jpeg with quality 90
W1227 12:03:55.221762 Dicomizer.cpp:91] Creating level 0 of size 720x1648
W1227 12:03:55.221770 Dicomizer.cpp:96] Transcoding the source pyramid
W1227 12:03:55.221797 ApplicationToolbox.cpp:107] Running 8 tasks
W1227 12:03:55.221822 ApplicationToolbox.cpp:108] Using 4 threads for the computation
W1227 12:03:55.322202 ApplicationToolbox.cpp:129] All tasks have finished
W1227 12:03:55.327107 DicomPyramidWriter.cpp:183] Closing the DICOM pyramid (8 tiles were written)
W1227 12:03:55.327146 TiledPyramidStatistics.cpp:40] Closing the input image (0 raw accesses to the tiles, 8 decoded tiles)
```



Probably, some sort of “extension detector” should be put in place to convert the correct files, and not the thumbnail.
Comment 1 Sébastien Jodogne 2020-06-29 15:26:49 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-02-04.13:11:18]

Thanks for the report! The issue is now fixed in the mainline of the whole-slide imaging thanks to the following changeset: https://hg.orthanc-server.com/orthanc-wsi/changeset/c38811bf2992c4cf9bdaeb109053602794c8baa4
Comment 2 Sébastien Jodogne 2020-06-29 15:27:39 CEST
[BitBucket user: Alvaro Gonzalez]
[BitBucket date: 2020-04-16.20:12:35]

Verified on my test images \(although it took a while to build mainline, I’ve never done it with orthanc before:sweat_smile: \) but it works!

Hope to see it in a release soon :slight_smile:
Comment 3 Sébastien Jodogne 2020-06-29 15:28:00 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-05-27.12:35:44]

Thanks for your feedback! Release 0.7 is now available for download: [https://www.orthanc-server.com/browse.php?path=/whole-slide-imagin](https://www.orthanc-server.com/browse.php?path=/whole-slide-imaging)g
Comment 4 Sébastien Jodogne 2020-06-29 15:28:01 CEST
[BitBucket user: Alvaro Gonzalez]
[BitBucket date: 2020-05-27.13:45:59]

Great!