code: def test_nifti(db):
      studies = dft.get_studies(data_dir)
      data = studies[0].series[0].as_nifti()
      assert len(data) == 352 + 2 * 256 * 256 * 2
      h = nifti1.Nifti1Header(data[:348])
      assert h.get_data_shape() == (256, 256, 2)
  
imports: import os
  import sqlite3
  from io import BytesIO
  from os.path import dirname
  from os.path import join
  from ..testing import suppress_warnings
  import unittest
  import pytest
  from ..None import nifti1
  from ..optpkg import optional_package
label_desc: Use image node_id 8 for calling a global function with example usage: test_nifti(db) without return types