Neural-Systems-at-UIO / Multi-Image-OSd

Multi-Image OpenSeadragon viewer
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Mio is not showing the section images according to section number #14

Open Majpuc opened 2 years ago

Majpuc commented 2 years ago

Hi,

We are preparing Mio (and later LZ links) where several series are mixed. We thought Mio would display the order according to the section numbers but apparently not: https://miosdv.apps-dev.hbp.eu/index.html?bucket=https://data-proxy.ebrains.eu/api/v1/public/buckets/img-439ccbe7-c645-11ec-b100-00090faa0001&collectionMode=true&limit=200

Could you change some settings so it can follow the section numbers? or is it possible only in LZ?

darwinjob commented 2 years ago

Noo, it’s only possible in LZ. Just kidding :) Will sorting the file names alphabetically do the thing? Or you need something more advanced?

Majpuc commented 2 years ago

Good! I am not sure an alphabetic sorting will help. It would be good if it is able to recognize the file naming convention: s_xxx

darwinjob commented 2 years ago

OK. Since LZ is the gold standard :) for sorting @Tevemadar do you sort them alphabetically?

Tevemadar commented 2 years ago

I sort by the section numbers. While probably it's done in a complicated way, if I wrote the code today, I would simply take the _sxxx... part, and sort that alphabetically. This way the lettered sub-images would be sorted too. Something like

let sections=[{name:"WhateverElse_s123b"},
              {name:"Whatever_s124_timm"},
              {name:"WhateverElse_s123a_CO2"},
              {name:"WhateverElse_s123c_bda"}];
sections.sort((a,b)=>a.name.match(/(_s\d+.*)/)[0].localeCompare(b.name.match(/(_s\d+.*)/)[0]));
console.log(JSON.stringify(sections));
[{"name":"WhateverElse_s123a_CO2"},{"name":"WhateverElse_s123b"},{"name":"WhateverElse_s123c_bda"},{"name":"Whatever_s124_timm"}]
Majpuc commented 1 year ago

Hi @darwinjob What is the status here?