tests package — imagedata 1.3.0 documentation

# tests package

## Submodules

## tests.compare_headers module

`tests.compare_headers.` `compare_geometry_headers`(self, hdr, newhdr)

`tests.compare_headers.` `compare_headers`(self, hdr, newhdr, uid=True)

`tests.compare_headers.` `compare_optional`(self, a, b, attr)

`tests.compare_headers.` `compare_template_headers`(self, hdr, newhdr, uid=True)

## tests.context module

## tests.test_archive_file module

Test file archive

class `tests.test_archive_file.` `TestArchiveFile`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_mimetype`()
  `test_new_archive`()
  `test_unknown_mimetype`()
  `test_unknown_url`()

## tests.test_archive_zip module

Test zip archive

class `tests.test_archive_zip.` `TestArchiveZip`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_mimetype`()
  `test_new_archive`()
  `test_unknown_mimetype`()
  `test_unknown_url`()

## tests.test_axis module

class `tests.test_axis.` `TestAxis`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_uniform_axis`()
  `test_uniform_length_axis`()
  `test_uniform_length_axis_step2`()
  `test_variable_axis`()
  `test_variable_axis2`()
  `test_variable_axis_rgb`()

## tests.test_formats_dicom module

class `tests.test_formats_dicom.` `TestDicomPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_copy_dicom_4D`()
  `test_read_dicom_3D_no_opt`()
  `test_read_dicom_4D`()
  `test_read_dicom_user_defined_TI`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_two_files`()
  `test_write_dicom_4D`()
  `test_write_dicom_4D_no_opt`()
  `test_write_single_directory`()
  `test_write_single_file`()

class `tests.test_formats_dicom.` `TestDicomSlicing`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_slice_ellipsis_first`()
  `test_slice_ellipsis_last`()
  `test_slice_ellipsis_middle`()
  `test_slice_inplane`()
  `test_slice_time_z`()
  `test_slice_z`()

class `tests.test_formats_dicom.` `TestDicomZipPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_zip`()

class `tests.test_formats_dicom.` `TestWriteZipArchiveDicom`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_relative`()
  `test_read_single_file_wildcard`()
  `test_read_two_directories`()
  `test_read_two_files`()

class `tests.test_formats_dicom.` `TestZipArchiveDicom`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_relative`()
  `test_read_single_file_wildcard`()
  `test_read_two_directories`()
  `test_read_two_files`()

## tests.test_formats_dicom_color module

class `tests.test_formats_dicom_color.` `TestDicomColor`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_dicom_color`()
  `test_write_dicom_color`()

## tests.test_formats_dicom_template module

exception `tests.test_formats_dicom_template.` `ShouldHaveFailed`

  Bases: `Exception`

class `tests.test_formats_dicom_template.` `TestDicomTemplate`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  `test_dicom_geometry_cmdline`()
  `test_dicom_geometry_prog`()
  `test_dicom_temp_slice`()
  `test_dicom_tempgeom_cmdline`()
  `test_dicom_tempgeom_prog`()
  `test_dicom_template_cmdline`()
  `test_dicom_template_prog`()

## tests.test_formats_dicom_zip module

Test zip archive

class `tests.test_formats_dicom_zip.` `TestDicomZipRead`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_wildcard`()
  `test_read_two_files`()
  `test_read_two_files2`()

class `tests.test_formats_dicom_zip.` `TestDicomZipWrite`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_all_files`()
  `test_write_single_file`()

## tests.test_formats_itk module

Test writing data

class `tests.test_formats_itk.` `TestFileArchiveItk`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_file_not_found`()
  `test_read_2D`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_two_files`()
  `test_write_3d_single_file`()
  `test_write_4d_single_directory`()
  `test_write_4d_single_directory_explicit`()

class `tests.test_formats_itk.` `TestWritePluginITKSlice`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_3d_itk`()
  `test_write_3d_itk_no_opt`()
  `test_write_4d_itk`()

class `tests.test_formats_itk.` `TestWritePluginItkTag`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_3d_itk`()
  `test_write_4d_itk`()

`tests.test_formats_itk.` `list_files`(startpath)

## tests.test_formats_itk_template module

exception `tests.test_formats_itk_template.` `ShouldHaveFailed`

  Bases: `Exception`

class `tests.test_formats_itk_template.` `TestItkTemplate`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_itk_geometry_cmdline`()
  `test_itk_geometry_prog`()
  `test_itk_tempgeom_cmdline`()
  `test_itk_tempgeom_prog`()
  `test_itk_template_cmdline`()
  `test_itk_template_prog`()

## tests.test_formats_itk_zip module

Test zip archive

class `tests.test_formats_itk_zip.` `TestItkZipRead`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_relative`()
  `test_read_single_file_wildcard`()
  `test_read_two_files`()

class `tests.test_formats_itk_zip.` `TestItkZipWrite`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_all_files`()
  `test_write_single_file`()

## tests.test_formats_mat module

class `tests.test_formats_mat.` `Test3DMatPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_2D`()
  `test_read_3d_mat_no_opt`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_two_files`()
  `test_write_3d_mat`()
  `test_write_3d_mat_no_opt`()
  `test_write_single_directory`()
  `test_write_single_file`()
  `test_zipread_all_files`()
  `test_zipread_single_directory`()
  `test_zipread_single_file`()
  `test_zipread_single_file_relative`()
  `test_zipread_single_file_wildcard`()

class `tests.test_formats_mat.` `Test4DMatPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_4d_mat`()

`tests.test_formats_mat.` `list_files`(startpath)

## tests.test_formats_mat_zip module

Test zip archive

class `tests.test_formats_mat_zip.` `TestMatZipRead`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_relative`()
  `test_read_single_file_wildcard`()
  `test_read_two_files`()

class `tests.test_formats_mat_zip.` `TestMatZipWrite`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_all_files`()
  `test_write_single_file`()

## tests.test_formats_nifti module

class `tests.test_formats_nifti.` `Test3DNIfTIPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_compare_qform_to_dicom`()
  `test_qform_3D`()
  `test_read_2D`()
  `test_read_3D`()
  `test_read_3d_nifti`()
  `test_read_3d_nifti_no_opt`()
  `test_read_single_file`()
  `test_read_two_files`()
  `test_write_3d_nifti_no_opt`()
  `test_write_single_file`()
  `test_zipread_all_files`()
  `test_zipread_single_directory`()
  `test_zipread_single_file`()

class `tests.test_formats_nifti.` `Test4DNIfTIPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_4d_nifti`()

## tests.test_formats_nifti_zip module

Test zip archive

class `tests.test_formats_nifti_zip.` `TestNiftiZipRead`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_all_files`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_relative`()
  `test_read_single_file_wildcard`()
  `test_read_two_files`()

class `tests.test_formats_nifti_zip.` `TestNiftiZipWrite`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_write_all_files`()
  `test_write_single_file`()

## tests.test_formats_ps module

class `tests.test_formats_ps.` `Test2DPSPlugin`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_read_large_file`()
  `test_read_single_directory`()
  `test_read_single_file`()
  `test_read_single_file_gray`()
  `test_read_two_files`()
  `test_write_single_directory`()
  `test_write_single_file`()
  `test_zipread_a_directory`()
  `test_zipread_all`()
  `test_zipread_single_file`()
  `test_zipread_two_files`()

## tests.test_series module

class `tests.test_series.` `TestSeries`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_assign_slice`()
  `test_assign_slice_x`()
  `test_copy_series`()
  `test_copy_series2`()
  `test_create_series`()
  `test_cross_talk`()
  `test_cross_talk_2`()
  `test_cross_talk_3`()
  `test_cross_talk_spacing`(**kw)
  `test_ellipsis_first`()
  `test_ellipsis_middle`()
  `test_get_keyword`()
  `test_increase_ndim`()
  `test_max`()
  `test_multiple_ellipses`()
  `test_print_header`()
  `test_repr`()
  `test_repr_vol`()
  `test_slicing_dim`()
  `test_slicing_t`()
  `test_slicing_t_neg`()
  `test_slicing_x`()
  `test_slicing_x_neg`()
  `test_slicing_y`()
  `test_slicing_y_neg`()
  `test_slicing_z`()
  `test_slicing_z_neg`()
  `test_subtract_series`()

## tests.test_transport_dicomtransport module

class `tests.test_transport_dicomtransport.` `TestDicomTransport`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  static `handle_store`(event)

    Store the pydicom Dataset ds.

    Parameters

      event (pydicom.event) –

    Returns

      status – The status returned to the peer AE in the C-STORE response. Must be a valid C-STORE status value for the applicable Service Class as either an `int` or a `Dataset` object containing (at a minimum) a (0000,0900) Status element.

    Return type

      int or pydicom.dataset.Dataset

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `setupDicomSCP`(port=11112)
  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  `test_transport_cget_series`()
  `test_transport_single_image`()
  `test_transport_single_image_calling_aet`()
  `test_transport_walk`()

## tests.test_transport_filetransport module

Test file archive

class `tests.test_transport_filetransport.` `TestFiletransport`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_isfile`()
  `test_open_file`()
  `test_open_new`()
  `test_open_nonexist`()
  `test_open_nonexist_dir`()
  `test_readfile`()
  `test_walk`()
  `test_write_then_read`()

## tests.test_version module

class `tests.test_version.` `TestVersion`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_version`()

## Module contents