Frame index is always 0
When I acces to the measurements in the measurement table, it turns out that the attribute frameIndex is always 0. It turns out that they are some statements such as
const frameIndex = sopInstance.frame || 0;
(ohif-core\src\measurements\lib\getImageAttributes) because it looks like it's undefined. Do you have any idea of where the problem come from?
Many thanks in advance,
Mathis
Hi Mathis,
Thanks for the report.
So sopInstance.frame is undefined for multi-frame images? or for all images? We recently had an issue with the imageId as well: https://github.com/OHIF/ohif-core/commit/effab8d7c1a295f072397b0019c15d5acbbd2cfa
Hi Erik, Thanks for your response,
It appears that it is undefined whether the image is multi-frame or not. I don't know if this has something to do with imageId, what do you think?
I don't understand this part of the code.
- Number of frames is always undefined so it always goes to 'else'
- Why there would be a for-loop if we are already looping on the frames?
Maybe I'm missing something here, Thanks for the help!
I found the problem if you are interested, it turns out that the actual name of the frameIndex is instanceNumber
const frameIndex = sopInstance.instanceNumber || 0;
That way i get the frameIndex in the measurementTable
Instance number is not the same as frame index. An instance can have multiple frames. The loop above that you pointed out is indeed confusing because it says displaySet.images, when it should really say displaySet.instances. This is our fault for being bad at naming things. We should clean that up.
The hierarchy is Study > Series > Instances > Frames, but in the majority of cases, an Instance only has one frame. See http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.html
If e.g. you have a multiframe ultrasound, it would be one instance with hundreds of frames. The frameIndex would be used to explain which frame inside this multiframe instance is currently being displayed by Cornerstone.