code: def test_voxel_sizes(self):
      # Test voxel size calculation
      fake_mf = copy(self.MINIMAL_MF)
      MFW = self.WRAPCLASS
      dw = MFW(fake_mf)
      with pytest.raises(didw.WrapperError):
          dw.voxel_sizes
      # Make a fake frame
      fake_frame = fake_frames(
          "PixelMeasuresSequence", "PixelSpacing", [[2.1, 3.2]]
      )[0]
      fake_mf["SharedFunctionalGroupsSequence"] = [fake_frame]
      # Still not enough, we lack information for slice distances
      with pytest.raises(didw.WrapperError):
          MFW(fake_mf).voxel_sizes
      # This can come from SpacingBetweenSlices or frame SliceThickness
      fake_mf["SpacingBetweenSlices"] = 4.3
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 4.3])
      # If both, prefer SliceThickness
      fake_frame.PixelMeasuresSequence[0].SliceThickness = 5.4
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 5.4])
      # Just SliceThickness is OK
      del fake_mf["SpacingBetweenSlices"]
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 5.4])
      # Removing shared leads to error again
      fake_mf["SharedFunctionalGroupsSequence"] = [None]
      with pytest.raises(didw.WrapperError):
          MFW(fake_mf).voxel_sizes
      # Restoring to frames makes it work again
      fake_mf["PerFrameFunctionalGroupsSequence"] = [fake_frame]
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 5.4])
      # Decimals in any field are OK
      fake_frame = fake_frames(
          "PixelMeasuresSequence",
          "PixelSpacing",
          [[Decimal("2.1"), Decimal("3.2")]],
      )[0]
      fake_mf["SharedFunctionalGroupsSequence"] = [fake_frame]
      fake_mf["SpacingBetweenSlices"] = Decimal("4.3")
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 4.3])
      fake_frame.PixelMeasuresSequence[0].SliceThickness = Decimal(
          "5.4"
      )
      assert_array_equal(MFW(fake_mf).voxel_sizes, [2.1, 3.2, 5.4])
  
imports: import gzip
  from copy import copy
  from decimal import Decimal
  from hashlib import sha1
  from os.path import dirname
  from os.path import join
  from unittest import TestCase
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ...tests.nibabel_data import get_nibabel_data, needs_nibabel_data
  from ...volumeutils import endian_codes
  from ..None import dicomreaders
  from ..None import dicomwrappers
  from .None import dicom_test, have_dicom, pydicom
label_desc: Use image node_id 3 for calling the TestMultiFrameWrapper obj's underlying member method code with example usage: obj.test_voxel_sizes() without return types