0

I'm using papaya js for viewing medical images.

My problem :-

Papaya js automatically ordering the slices according to metadata.

Ex:

My array format like this below,

params['images'] = ['3.dcm','5.dcm','2.dcm','4.dcm','1.dcm'];

In my viewer i can see the order like this below

params['images'] = ['1.dcm','2.dcm','3.dcm','4.dcm','5.dcm'];

The expected output:-

How i'm making my array order, same like that, I want to see the slices order in my viewer.

params['images'] = ['3.dcm','5.dcm','2.dcm','4.dcm','1.dcm'];

I'm using this PAPAYA DICOM VIEWER API

The same question I asked in github also

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Ashok Charu
  • 274
  • 2
  • 23
  • 1
    There's been a sudden influx of questions about this. Note that Papaya ordering the slices according to metadata is a *feature* -- but I can see the usefulness of adding an option to use an explicit order, ignoring metadata. Can you please make a feature request here: https://github.com/rii-mango/Papaya/issues and I'll get the feature added. – martinez314 Jun 26 '18 at 23:02
  • @whiskeyspider I haded the issue in github https://github.com/rii-mango/Papaya/issues/124 please check – Ashok Charu Jun 27 '18 at 05:59

1 Answers1

1

You can now use the global variable daikon.Series.useExplicitOrdering. Set it to true to ignore the default behavior of metadata-based ordering or images. This will also support using duplicate slices. For example:

<script type="text/javascript">
    daikon.Series.useExplicitOrdering = true;

    var params = [];
    params["images"] = [[
        "data/dicom/brain_001.dcm", 
        "data/dicom/brain_002.dcm", 
        "data/dicom/brain_003.dcm"]];
</script>

However, since with this option it cannot rely on measuring the distance between slices to calculate spacing, it will either have to use Slice Thickness (0018,0050) or you can specify what spacing you'd like to use with daikon.Series.useExplicitSpacing. For example:

<script type="text/javascript">
    daikon.Series.useExplicitOrdering = true;
    daikon.Series.useExplicitSpacing = 8; // mm

    var params = [];
    // ...
</script>

The solution to this involved adding the new options to Daikon (the DICOM parser sub-project that Papaya uses) as well as maintaining the original order of the URLs in Papaya, which before it didn't care about.

martinez314
  • 12,162
  • 5
  • 36
  • 63