tests package

Submodules

tests.compare_headers module

tests.compare_headers.compare_axes(self, axes, new_axes)[source]
tests.compare_headers.compare_geometry_headers(self, hdr, newhdr)[source]
tests.compare_headers.compare_headers(self, hdr, newhdr, uid=True)[source]
tests.compare_headers.compare_optional(self, a, b, attr)[source]
tests.compare_headers.compare_pydicom(self, orig, temp, uid=False)[source]
tests.compare_headers.compare_template_headers(self, hdr, newhdr, uid=True)[source]

tests.context module

tests.test_archive_file module

Test file archive

class tests.test_archive_file.TestArchiveFile(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_mimetype()[source]
test_new_archive()[source]
test_read_one_file()[source]
test_unknown_mimetype()[source]
test_unknown_url()[source]

tests.test_archive_zip module

Test zip archive

class tests.test_archive_zip.TestArchiveZip(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_mimetype()[source]
test_new_archive()[source]
test_unknown_mimetype()[source]
test_unknown_url()[source]

tests.test_axis module

class tests.test_axis.TestAxis(methodName='runTest')[source]

Bases: TestCase

test_uniform_axis()[source]
test_uniform_length_axis()[source]
test_uniform_length_axis_step2()[source]
test_variable_axis()[source]
test_variable_axis2()[source]
test_variable_axis_rgb()[source]

tests.test_formats_dicom module

class tests.test_formats_dicom.TestDicomPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_user_defined_sort()[source]
class tests.test_formats_dicom.TestDicomSlicing(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_slice_ellipsis_first()[source]
test_slice_ellipsis_last()[source]
test_slice_ellipsis_middle()[source]
test_slice_inplane()[source]
test_slice_time_z()[source]
test_slice_z()[source]
class tests.test_formats_dicom.TestDicomZipPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_zip()[source]
class tests.test_formats_dicom.TestWriteZipArchiveDicom(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_dicom_not_DWI()[source]
test_read_dicom_not_DWI_no_CSA()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_directories()[source]
test_read_two_files()[source]
class tests.test_formats_dicom.TestZipArchiveDicom(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_directories()[source]
test_read_two_files()[source]

tests.test_formats_dicom_color module

class tests.test_formats_dicom_color.TestDicomColor(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_dicom_color()[source]
test_write_dicom_color()[source]

tests.test_formats_dicom_template module

exception tests.test_formats_dicom_template.ShouldHaveFailed[source]

Bases: Exception

class tests.test_formats_dicom_template.TestDicomGeometryTemplate(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_dicom_too_few_template_slices()[source]
test_dicom_too_few_template_tags()[source]
test_dicom_too_many_template_slices()[source]
test_dicom_too_many_template_tags()[source]
class tests.test_formats_dicom_template.TestDicomTemplate(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_dicom_geometry_cmdline()[source]
test_dicom_geometry_prog()[source]
test_dicom_temp_slice()[source]
test_dicom_tempgeom_cmdline()[source]
test_dicom_tempgeom_prog()[source]
test_dicom_template_cmdline()[source]
test_dicom_template_prog()[source]

tests.test_formats_dicom_zip module

Test zip archive

class tests.test_formats_dicom_zip.TestDicomZipRead(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
test_read_two_files2()[source]
class tests.test_formats_dicom_zip.TestDicomZipWrite(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_itk module

Test writing data

class tests.test_formats_itk.TestFileArchiveItk(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_file_not_found()[source]
test_itk_plugin()[source]
test_read_2D()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_single_file()[source]
test_write_4d_single_directory()[source]
test_write_4d_single_directory_explicit()[source]
test_write_ndarray()[source]
test_write_single_file_not_directory()[source]
class tests.test_formats_itk.TestWritePluginITKSlice(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_3d_itk()[source]
test_write_3d_itk_no_opt()[source]
test_write_4d_itk()[source]
class tests.test_formats_itk.TestWritePluginItkTag(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_4d_itk()[source]
tests.test_formats_itk.list_files(startpath)[source]

tests.test_formats_itk_template module

exception tests.test_formats_itk_template.ShouldHaveFailed[source]

Bases: Exception

class tests.test_formats_itk_template.TestItkTemplate(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_itk_geometry_cmdline()[source]
test_itk_geometry_prog()[source]
test_itk_tempgeom_cmdline()[source]
test_itk_tempgeom_prog()[source]
test_itk_template_cmdline()[source]
test_itk_template_prog()[source]

tests.test_formats_itk_zip module

Test zip archive

class tests.test_formats_itk_zip.TestItkZipRead(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
class tests.test_formats_itk_zip.TestItkZipWrite(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_mat module

class tests.test_formats_mat.Test3DMatPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_mat_plugin()[source]
test_read_2D()[source]
test_read_3d_mat_no_opt()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_mat()[source]
test_write_3d_mat_no_opt()[source]
test_write_ndarray()[source]
test_write_single_directory()[source]
test_write_single_file()[source]
test_write_single_file_not_directory()[source]
test_zipread_all_files()[source]
test_zipread_single_directory()[source]
test_zipread_single_file()[source]
test_zipread_single_file_relative()[source]
test_zipread_single_file_wildcard()[source]
class tests.test_formats_mat.Test4DMatPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_4d_mat()[source]
tests.test_formats_mat.list_files(startpath)[source]

tests.test_formats_mat_zip module

Test zip archive

class tests.test_formats_mat_zip.TestMatZipRead(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
class tests.test_formats_mat_zip.TestMatZipWrite(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_nifti module

class tests.test_formats_nifti.Test3DNIfTIPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_compare_qform_to_dicom()[source]
test_nifti_plugin()[source]
test_qform_3D()[source]
test_read_3d_nifti_no_opt()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_nifti_no_opt()[source]
test_write_ndarray()[source]
test_write_single_file_in_directory()[source]
test_write_single_file_not_directory()[source]
test_zipread_all_files()[source]
test_zipread_single_directory()[source]
test_zipread_single_file()[source]
class tests.test_formats_nifti.Test4DNIfTIPlugin(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_4d_nifti_dwi()[source]
test_write_4d_nifti_time()[source]
class tests.test_formats_nifti.TestNIfTIPluginWrite(methodName='runTest')[source]

Bases: TestCase

test_write_dicom()[source]
class tests.test_formats_nifti.TestReadNIfTIPlugin(methodName='runTest')[source]

Bases: TestCase

test_compare_cor_hf()[source]
test_compare_cor_oblique()[source]
test_compare_cor_rl()[source]
test_compare_sag_ap()[source]
test_compare_sag_hf()[source]
test_compare_sag_oblique()[source]
test_compare_tra_oblique()[source]
test_compare_tra_rl()[source]
class tests.test_formats_nifti.TestWriteNIfTIPlugin(methodName='runTest')[source]

Bases: TestCase

test_cor_hf()[source]
test_cor_oblique()[source]
test_cor_rl()[source]
test_sag_ap()[source]
test_sag_hf()[source]
test_sag_oblique()[source]
test_tra_oblique()[source]
test_tra_rl()[source]

tests.test_formats_nifti_zip module

Test zip archive

class tests.test_formats_nifti_zip.TestNiftiZipRead(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
class tests.test_formats_nifti_zip.TestNiftiZipWrite(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_write_single_file()[source]

tests.test_series module

class tests.test_series.TestSeries(methodName='runTest')[source]

Bases: TestCase

test_align_2d()[source]
test_align_3d()[source]
test_align_3d_few_slices_on_many()[source]
test_align_3d_on_4d()[source]
test_align_4d_on_3d()[source]
test_assign_slice()[source]
test_assign_slice_input_order()[source]
test_assign_slice_x()[source]
test_copy_series()[source]
test_copy_series2()[source]
test_create_series()[source]
test_create_series_1()[source]
test_create_series_tuple_1D()[source]
test_cross_talk()[source]
test_cross_talk_2()[source]
test_cross_talk_3()[source]
test_cross_talk_dicom_series_template()[source]
test_cross_talk_series_ref()[source]
test_cross_talk_series_template()[source]
test_cross_talk_spacing()[source]
test_cross_talk_wl()[source]
test_cross_talk_wl_ref()[source]
test_ellipsis_first()[source]
test_ellipsis_middle()[source]
test_fuse_mask_3d_bw_float()[source]
test_fuse_mask_3d_bw_uint8()[source]
test_fuse_mask_3d_rgb_float()[source]
test_fuse_mask_3d_rgb_uint8()[source]
test_fuse_mask_3d_variable()[source]
test_fuse_mask_3d_variable_maskrange()[source]
test_fuse_mask_lena()[source]
test_get_keyword()[source]
test_get_rgb_voxel()[source]
test_get_rgb_voxel_np()[source]
test_get_rgb_voxel_np_rgb()[source]
test_header_axes()[source]
test_increase_ndim()[source]
test_max()[source]
test_multiple_ellipses()[source]
test_numpy_mask()[source]
test_print_header()[source]
test_repr()[source]
test_repr_vol()[source]
test_set_axes()[source]
test_set_incorrect_slice_locations()[source]
test_set_variable_slice_locations()[source]
test_slicing_dim()[source]
test_slicing_t()[source]
test_slicing_t_drop()[source]
test_slicing_t_neg()[source]
test_slicing_x()[source]
test_slicing_x_neg()[source]
test_slicing_y()[source]
test_slicing_y_neg()[source]
test_slicing_z()[source]
test_slicing_z_neg()[source]
test_str()[source]
test_subtract_series()[source]
test_sum_with_series_mask()[source]
test_vertices_from_3d_grid()[source]
test_zeros_like()[source]

tests.test_transport_dicomtransport module

class tests.test_transport_dicomtransport.TestDicomTransport(methodName='runTest')[source]

Bases: TestCase

static handle_store(event)[source]

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()[source]

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

setupDicomSCP(port=11112)[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_transport_cget_series()[source]
test_transport_single_image()[source]
test_transport_single_image_calling_aet()[source]
test_transport_walk()[source]

tests.test_transport_filetransport module

Test file archive

class tests.test_transport_filetransport.TestFiletransport(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_isfile()[source]
test_open_file()[source]
test_open_new()[source]
test_open_nonexist()[source]
test_open_nonexist_dir()[source]
test_readfile()[source]
test_walk()[source]
test_write_then_read()[source]

tests.test_version module

class tests.test_version.TestVersion(methodName='runTest')[source]

Bases: TestCase

test_version()[source]

Module contents