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'];
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.