fix(core): resized multiframe series are saved as invalid DICOM with GDCM
Description
When the number of frames/slices of an ImageSeries that holds a multi-frame series is reduced, GDCM will not take into account the new size, but still write the no more relevant frame data (such FrameAcquisitionDateTime). We still be able to read the DICOM back correctly, but some third party software, like Alizam are complaining.
Steps to reproduce
- Create an ImageSeries with more than 3 slices/frames
- Set a FrameAcquisitionDateTime to all frames
- Resize the original to 2 slices
- ImageSeries::getFrameAcquisitionDateTime(2) returns a value. It should return std::nullopt.
Proposal
Fix the bug by removing unneeded data when resizing the ImageSeries
Functional specifications
No Change. Retrieving data from deleted slices was a bug anyway
Technical specifications
- make Image::resize() virtual
- Reimplemented in ImageSeries::resize(), which call Series::shrinkFrames(), which removes unneeded frame data from the GDCM dataset
Test plan
- unit test...