ImagingDataCommons / slim

Interoperable web-based slide microscopy viewer and annotation tool
https://imagingdatacommons.github.io/slim/
Apache License 2.0
118 stars 36 forks source link

docker-compose local instance, testing/ storing DICOM? #147

Closed michalogit closed 1 year ago

michalogit commented 1 year ago

Dear slim developers,

I have tried running slim with docker-compose. Locally, on a mac. Have some issues with starting it and storing example DICOM files. Or maybe do not understand something from your descriptions/documentation. Would be grateful for hints and/or answers to the questions below.

The docker-compose from the release versions seems to be up happily:

$ docker-compose up -d
Docker Compose is now in the Docker CLI, try `docker compose up`

Starting slim-0121_db_1   ... done
Starting slim-0121_ldap_1 ... done
Starting slim-0121_arc_1  ... done
Starting slim-0121_app_1  ... done

$ docker-compose ps
      Name                    Command               State                            Ports                        
-------------------------------------------------------------------------------------------------------------------
slim-0121_app_1    /usr/bin/dumb-init -- ngin ...   Up      0.0.0.0:8008->8008/tcp                                
slim-0121_arc_1    /docker-entrypoint.sh stan ...   Up      11112/tcp, 12575/tcp, 2575/tcp, 2762/tcp, 8080/tcp,   
                                                            8443/tcp, 9990/tcp, 9993/tcp                          
slim-0121_db_1     docker-entrypoint.sh postgres    Up      5432/tcp                                              
slim-0121_ldap_1   /docker-entrypoint.sh slap ...   Up      389/tcp

At the http://localhost:8008/ can see the empty starting page of the slim app with "Accession number" and other table headers.

At https://localhost:9990/ where I'd expect according to its docs the admin interface of dcm4chee-arc-light there is ERR_CONNECTION_REFUSED

The example of storing the DICOM images in your description is actually the default help command line of dicomweb_client:

dicomweb_client -vv --url http://localhost:8008/dcm4chee-arc/aets/DCM4CHEE/rs store instances -h

So I run it on an example DICOM that way, which seems to be accepted:

$ dicomweb_client -vv --url http://localhost:8008/dcm4chee-arc/aets/DCM4CHEE/rs store instances --study test123 0003.DCM
2023-04-12 11:07:30,181 | INFO     | dicomweb_client.web                      | store instances

So I guess the webservices do the job somehow. But then, do not see this DICOM in the table at http://localhost:8008/

Questions:

  1. What to do exactly to send the DICOM/study to slim? Can you eg send me or publish an end-to-end example command line with an example DICOM file/study that actually does storing DICOM files that is compatible with the dockerized slim and makes DICOM visible in the webapp?

  2. How to check if/where the DICOM is stored, what folder, where it is in the app?

  3. Is my dcm4chee up and running or not? How to check it? What can be wrong with empty https://localhost:9990/

All the best, Michal

cgorman commented 1 year ago

Hi Michal,

Could you try the following please?

You can download test WSI instances from the IDC by following the instructions here.

Hope this helps!

hackermd commented 1 year ago

@michalogit thank you for your interest in Slim and for reporting the issue you are experiencing. I hope you will be able to get it to work by following @cgorman's suggestions.

To your specific questions:

What to do exactly to send the DICOM/study to slim? Can you eg send me or publish an end-to-end example command line with an example DICOM file/study that actually does storing DICOM files that is compatible with the dockerized slim and makes DICOM visible in the webapp?

As @cgorman pointed out, Slim only lists studies that contain slide microscopy images (i.e., DICOM image instances with modality "SM"). Therefore, make sure that your file 0003.DCM contains such an image instance. In addition, I suggest omitting the --study option to ensure that the content of the file gets posted. The test123 value you provided does not appear to be a valid DICOM Study Instance UID and it's hence possible that the DICOMweb client didn't post anything. Running dicomweb_client with increased verbosity - as suggested by @cgorman - will help in this regard as well.

How to check if/where the DICOM is stored, what folder, where it is in the app?

The easiest way to check the content of the archive is via the DICOMweb Study Service as suggested by @cgorman.

Is my dcm4chee up and running or not? How to check it? What can be wrong with empty https://localhost:9990/

Note that the docker-compose configuration does not expose the admin web interface of the DCM4CHE archive. Only the DICOMweb Study Service is exposed.

michalogit commented 1 year ago

Thank you Chris, Thank you Markus!

Yes, not being a specialist in the imaging, have missed the story that slim is created for the microscope slides and those are those with SM in DICOM.

So in fact my instance is working as expected, just did not have a proper SM example at hand. Now, I've done

 michalo$ dicomweb_client -vvvv --url http://localhost:8008/dcm4chee-arc/aets/DCM4CHEE/rs store instances --study test_4 test_SM.dcm 
2023-04-24 15:45:45,952 | DEBUG    | dicomweb_client.session_utils            | 20   | initialize HTTP session
2023-04-24 15:45:45,970 | INFO     | dicomweb_client.web                      | 2651 | store instances
2023-04-24 15:45:45,983 | INFO     | dicomweb_client.web                      | 1489 | store data in chunks using chunked transfer encoding
2023-04-24 15:45:45,983 | DEBUG    | dicomweb_client.web                      | 1485 | POST: http://localhost:8008/dcm4chee-arc/aets/DCM4CHEE/rs/studies {'Content-Type': 'multipart/related; type="application/dicom"; boundary="0f3cf5c0-70e0-41ef-baef-c6f9f65ec3e1"', 'Transfer-Encoding': 'chunked', 'Cache-Control': 'no-cache', 'Connection': 'Keep-Alive'}
2023-04-24 15:45:45,991 | DEBUG    | urllib3.connectionpool                   | 232  | Starting new HTTP connection (1): localhost:8008
2023-04-24 15:45:45,992 | DEBUG    | dicomweb_client.web                      | 1471 | serve data chunk #0
2023-04-24 15:45:46,002 | DEBUG    | dicomweb_client.web                      | 1471 | serve data chunk #1
2023-04-24 15:45:46,035 | DEBUG    | dicomweb_client.web                      | 1471 | serve data chunk #2
2023-04-24 15:45:46,076 | DEBUG    | dicomweb_client.web                      | 1471 | serve data chunk #3
2023-04-24 15:45:46,747 | DEBUG    | dicomweb_client.web                      | 1504 | request status code: 200

then confirmed that it is in there with the command

dicomweb_client --url=http://localhost:8008/dcm4chee-arc/aets/DCM4CHEE/rs search instances | grep SM

and at the same time I can see it in the web-UI. That's what I needed at that poing I think! I see also a bit better how the docker compose setup is done.

The use case is that I've been triaging Slim, asked by one of the labs, I work for the Scientific IT Services of ETH Zurich. I know that some groups doing medical imaging use eg SlideViewer, but imaging is not my daily business. Chances are that when the people from the lab start testing and using it, me an them may have other questions, now thank you for all the explanations!

michalogit commented 1 year ago

Btw, what is your recommendation for an easy tool for conversion of OME-TIFF into DICOM?

fedorov commented 1 year ago

I do not think there is an "easy tool", but may find materials on this page helpful in learning about some of the tools that are available: https://projectweek.na-mic.org/PW38_2023_GranCanaria/Projects/IDC_DICOM_WSI_workflow/.

hackermd commented 1 year ago

@michalogit glad you got it to work. It appears we may want to further improve the documentation for storing data in an archive and checking whether data was stored correctly.

@cgorman would it make sense to add your suggestions to the README?