Giter Club home page Giter Club logo

Comments (2)

hackermd avatar hackermd commented on August 10, 2024 1

I don't think you have done something wrong. Your code and the resulting HTTP request looks fine. The server at https://dicomcloud.azurewebsites.net responds with status code 404. It looks like the returned metadata is not up-to-date, i.e. that instances are listed but do not (or no longer) exist.

I've written the following program to independently test the approach:

import logging

import requests
import dicomweb_client

test_logger = logging.getLogger('test_dicomweb_client')


def test_walk(client):
    matched_studies = client.search_for_studies()
    for study in matched_studies:
        study_instance_uid = study['0020000D']['Value'][0]
        matched_series = client.search_for_series(study_instance_uid)
        for series in matched_series:
            series_instance_uid = series['0020000E']['Value'][0]
            matched_instances = client.search_for_instances(
                study_instance_uid,
                series_instance_uid
            )
            for instance in matched_instances:
                sop_instance_uid = instance['00080018']['Value'][0]
                try:
                    dataset = client.retrieve_instance(
                        study_instance_uid,
                        series_instance_uid,
                        sop_instance_uid
                    )
                except requests.exceptions.HTTPError:
                    test_logger.error(
                        'Instance not found: study={study_instance_uid}, '
                        'series={series_instance_uid}, '
                        'instance={sop_instance_uid}'.format(**locals())
                    )


if __name__ == '__main__':

    logging.basicConfig(level=logging.INFO)

    dicomweb_client_logger = logging.getLogger('dicomweb_client')
    dicomweb_client_logger.setLevel(logging.DEBUG)

    client = dicomweb_client.DICOMwebClient(
        url='https://dicomcloud.azurewebsites.net',
        qido_url_prefix='qidors',
        wado_url_prefix='wadors',
        stow_url_prefix='stowrs'
    )
    test_walk(client)

I further tested the approach using the DICOMcloud interface at https://dicomcloud.azurewebsites.net/swagger. Retrieval of instances via WADO-RS also fails using the metadata returned by QIDO-RS queries:

QIDO-RS: SearchForSeries (given StudyInstanceUID):
screenshot_search_for_series

QIDO-RS: SearchForInstances (given StudyInstanceUID and SeriesInstanceUID):
screenshot_search_for_instances

WADO-RS: RetrieveInstance:
screenshot_retrieve_instance

from dicomweb-client.

nordlow avatar nordlow commented on August 10, 2024

Thanks for looking at this!

Are all instances missing?

from dicomweb-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.