Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank Image Issue with CT Image Storage (1.2.840.10008.5.1.4.1.1.2) #545

Open
DarineZeyad opened this issue Nov 11, 2024 · 0 comments
Open

Comments

@DarineZeyad
Copy link

When retrieving DICOM images with the following attributes:

  • SOP Class: 1.2.840.10008.5.1.4.1.1.2 (CT Image Storage)
  • Transfer Syntax: 1.2.840.10008.1.2.1 (Explicit VR Little Endian)

The image is retrieved without pixelData (resulting in black pixels) if the requested transfer syntax is set to JPEG (1.2.840.10008.1.2.4.50, Default Transfer Syntax for Lossy JPEG 8-bit Image Compression). When retrieving the same DICOM externally without the loader in JPEG format, the image renders fine.

Additional Observations:

  • Changing convertFloatPixelDataToInt from false to true renders the image but with high contrast and brightness. The reason for this effect is unclear to me.

CornerstoneWADOImageLoader Initialisation:

private static initCornerstoneWADOImageLoader() {
    cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
    cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
    cornerstoneWADOImageLoader.configure({
      useWebWorkers: true,
      decodeConfig: {
        convertFloatPixelDataToInt: false,
      },
      beforeSend: function (xhr) {
        xhr.setRequestHeader(
          "Authorization",
          `Bearer ...`
        );

        xhr.setRequestHeader(
          "Accept",
          'multipart/related; type="image/jpeg"; transfer-syntax=1.2.840.10008.1.2.4.50'
        );
      },
      onloadend: function (event, params) {
        // ..
      },
    });

    let maxWebWorkers = 1;

    if (navigator.hardwareConcurrency) {
      maxWebWorkers = Math.min(navigator.hardwareConcurrency, 7);
    }

    var config = {
      maxWebWorkers,
      startWebWorkersOnDemand: false,
      taskConfiguration: {
        decodeTask: {
          initializeCodecsOnStartup: false,
          strict: false,
        },
      },
      webWorkerTaskPaths: [
        "https://unpkg.com/[email protected]/dist/610.bundle.min.worker.js",
        "https://unpkg.com/[email protected]/dist/888.bundle.min.worker.js",
      ],
    };

    cornerstoneWADOImageLoader.webWorkerManager.initialize(config);
  }

  private static initProviders(orgID: string) {
    const { calibratedPixelSpacingMetadataProvider } = cornerstone.utilities;
    cornerstone.metaData.addProvider(
      ptScalingMetaDataProvider.get.bind(ptScalingMetaDataProvider),
      10000
    );
    cornerstone.metaData.addProvider(
      calibratedPixelSpacingMetadataProvider.get.bind(
        calibratedPixelSpacingMetadataProvider
      ),
      11000
    );

    cornerstone.metaData.addProvider(customMetaDataProvider, 12000);
  }

Preferred Setup: The preference is to retrieve images as JPEG rather than octet-stream for improved loading performance.

VERSIONS:
"@cornerstonejs/core": "^0.27.1",
"@cornerstonejs/streaming-image-volume-loader": "^0.11.2",
"cornerstone-wado-image-loader": "^4.10.2",

You can try with this DICOM sample:
1.2.840.113619.2.25.1.1762306543.872804962.230.zip

Any recommendations for optimal configuration settings to handle JPEG image retrieval effectively would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant