コード例 #1
0
def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys):
    dicomweb.dicomweb_store_instance(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        dcm_file)

    dicomweb.dicomweb_retrieve_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)

    out, _ = capsys.readouterr()

    # Check that store instance worked
    assert 'Retrieved study with UID:' in out

    dicomweb.dicomweb_delete_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)
コード例 #2
0
ファイル: dicomweb_test.py プロジェクト: dcm454/g-vision
def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys):
    dicomweb.dicomweb_store_instance(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        dcm_file)

    dicomweb.dicomweb_retrieve_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)

    out, _ = capsys.readouterr()

    # Check that store instance worked
    assert 'Retrieved study with UID:' in out

    dicomweb.dicomweb_delete_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)
コード例 #3
0
ファイル: dicomweb_test.py プロジェクト: T-Aruga/gke-tutorial
def test_dicomweb_delete_study(test_dataset, test_dicom_store, capsys):
    dicomweb.dicomweb_store_instance(base_url, project_id, cloud_region,
                                     dataset_id, dicom_store_id, dcm_file)

    dicomweb.dicomweb_delete_study(base_url, project_id, cloud_region,
                                   dataset_id, dicom_store_id, study_uid)

    out, _ = capsys.readouterr()

    # Check that store instance worked
    assert "Deleted study." in out
コード例 #4
0
def test_dicomweb_retrieve_rendered(test_dataset, test_dicom_store, capsys):
    dicomweb.dicomweb_store_instance(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        dcm_file)

    dicomweb.dicomweb_retrieve_rendered(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid,
        series_uid,
        instance_uid)

    # Assert rendered image was downloaded
    assert os.path.isfile('rendered_image.png')

    out, _ = capsys.readouterr()

    # Check that retrieve rendered image worked
    assert 'Retrieved rendered image' in out

    # Delete downloaded rendered image
    os.remove('rendered_image.png')

    dicomweb.dicomweb_delete_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)
コード例 #5
0
def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys):
    dicomweb.dicomweb_store_instance(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        dcm_file)

    dicomweb.dicomweb_retrieve_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)

    # Assert study was downloaded
    assert os.path.isfile('study.multipart')

    out, _ = capsys.readouterr()

    # Check that retrieve study worked
    assert 'Retrieved study' in out

    # Delete downloaded study
    os.remove('study.multipart')

    dicomweb.dicomweb_delete_study(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        dicom_store_id,
        study_uid)
コード例 #6
0
def test_dicomweb_search_instance_studies(test_dataset, test_dicom_store,
                                          capsys):
    dicomweb.dicomweb_store_instance(service_account_json, base_url,
                                     project_id, cloud_region, dataset_id,
                                     dicom_store_id, dcm_file)

    dicomweb.dicomweb_search_instance(service_account_json, base_url,
                                      project_id, cloud_region, dataset_id,
                                      dicom_store_id)

    dicomweb.dicomweb_search_studies(service_account_json, base_url,
                                     project_id, cloud_region, dataset_id,
                                     dicom_store_id)

    out, _ = capsys.readouterr()

    # Check that search instance worked
    assert 'Instances:' in out
    # Check that search studies worked
    assert 'Patients found matching query' in out

    dicomweb.dicomweb_delete_study(service_account_json, base_url, project_id,
                                   cloud_region, dataset_id, dicom_store_id,
                                   study_uid)