Customize appearance of the front end¶
Below we show a few examples of how to customize the Gen3 Data Portal.
For a more technical and complete background, see portal configurations on GitHub.
Login Page¶
Login Image¶
Customize the image that appears on the Login Page with a vector graphic (eg. *.svg) of your choice.

Information on Login and Commons¶
Customize the text that appears on the Login Page by specifying title, description, subtitle, contact, or email.
Landing Page¶
Information on Commons¶
Customize the name of the Data Commons, the info text, and the button below that appear on the top left side of the Landing Page after logging in.

Summary Statistics¶
Customize the summary statistics that appear on the top right side of the Landing Page after logging in. The attributes are graphQL fields, which must be in the dictionary, configured in the etlMapping.yaml, and populated with data on the backend.

- Review the code to edit graphQL queries.
- Review the code to edit the graphQl queries after being logged in.
Cards¶
Customize the cards that appear on the bottom of the Landing Page after logging in.

- Review the code to edit name, icons, body, link, and label of the cards.
- Adding a new icon requires saving the icon in this repository and in this file.
Navigation Items¶
Customize the icons, link, and names that appear on the Data Commons navigation bar. The "tooltip" shows text upon hovering over the icon.

- [Review the code to edit icon, link, color, tooltip, and name of the navigation items][gitops.json navbar].
- Adding a new icon requires saving the icon in this repository and [in this file][icons inex].
Data Commons or Mesh Title¶
Customize the title that appears in the top left corner such as for the Biomedical Research Hub.

Top Bar¶
Customize the top bar that appears in the top right corner.

Color Theme¶
Customize the color theme for buttons, top navigation bar, and any types of charts on the Exploration and Landing Page.
Footer Logo¶
Customize the logos in the Footer.

Notebook Browser¶
Customize the Notebook Browser page to preview Jupyter Notebooks by adding images, titles, descriptions, and links to the Jupyter Notebook.

DICOM Viewer integration¶
In the Medical Imaging Data Resource Commons (MIDRC) we have integrated a DICOM Viewer into the Data Commons. We have included some details below on the integration.
Overview¶
We use the Ohif viewer for the frontend and the Orthanc server for the backend.
- Ohif viewer fork(https://github.com/uc-cdis/viewers)
- Orthanc server fork
- The Orthanc server supports custom authorization filters. We forked the repository so we could add a filter that communicates with the Gen3 policy engine to check user authorization.
- Orthanc supports various storage options. We are currently using PostgreSQL and investigating using AWS S3. Note that one of the two will likely not be maintained anymore in the future.
Deployment¶
Services¶
Add the DICOM viewer and one of the two DICOM server services to your deployment manifest:
"ohif-viewer": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/ohif-viewer:gen3-v3.8.0",
"dicom-server": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-orthanc:gen3-0.1.2",
"orthanc": "docker.io/osimis/orthanc:master",
ohif-vieweris the frontenddicom-serveris the backend set up to use PostgreSQLorthancis the backend set up to use AWS S3
If your Gen3 deployment uses cloud-automation, you can then set up the services by running:
gen3 kube-setup-dicomto set up and deployohif-viewerand/ororthanc(if you have chosen this server).gen3 kube-setup-dicom-serverto set up and deploydicom-server(do not run this if you have not chosen this server).
The Ohif viewer configuration may need to be updated as follows:
- Edit
~/Gen3Secrets/g3auto/orthanc-s3/app-config.js - Make sure
wadoUriRootis set to "/dicom-server/wado" if usingdicom-server, or "/orthanc/wado" if usingorthanc. - Similarly, set both
qidoRootandwadoRootto "/dicom-server/dicom-web" if usingdicom-server, or "/orthanc/dicom-web" if usingorthanc. - After making updates, run
kubectl delete secret orthanc-s3-g3auto && gen3 kube-setup-dicom
Once the services are deployed and the access configured, after logging in as an authorized user, you should be able to access the services at:
ohif viewer:<Gen3 portal hostname>/ohif-viewer/viewer?StudyInstanceUIDs=<DICOM study ID>dicom-server:<Gen3 portal hostname>/dicom-server/app/explorer.htmlorthanc:<Gen3 portal hostname>/orthanc/app/explorer.html
Authorization¶
See this doc for details on setting up authorization through a user.yaml file.
- For
ohif-vieweranddicom-server: - End users need the following access to view files in the DICOM viewer:
- service: "dicom-viewer"
- method: "read"
- resource: "/services/dicom-viewer/studies/\<DICOM study ID>"
- The recommended setup is to create a policy with access to all DICOM studies (resource "/services/dicom-viewer/studies") and grant it to all users, or to all logged in users.
- Administrators need the following access to interact with the server API (such as to submit files):
- service: "dicom-viewer"
- method: "create"
- resource: "/services/dicom-viewer"
- For
orthanc: in addition to the above, add the following: - End users:
- service: "orthanc"
- method: "read"
- resource: "/services/orthanc/studies" (note that per-study access is not supported at the moment)
- Administrators:
- service: "orthanc"
- method: "create"
- resource: "/services/orthanc"
- This may change in the future.
Portal explorer integration¶
The explorer page of the portal can be configured to link to the DICOM viewer. The elastic search documents must have a field corresponding to the DICOM study ID.

Configure your explorer page tab as follows:
"explorerConfig": [
{
"tabTitle": "Imaging Studies",
"table": {
"enabled": true,
"fields": [...],
"dicomViewerId": "dicom_study_id",
"dicomViewerUrl": "ohif-viewer",
"dicomServerURL": "dicom-server",
"linkFields": [
"dicom_study_id"
]
}
}
]
dicomViewerId: (optional) name of the field that corresponds to the DICOM study ID.dicomViewerUrl: (optional; default: "dicom-viewer") to override the path to the DICOM viewer.- Set to "ohif-viewer" if you're using the
ohif-viewerservice.
- Set to "ohif-viewer" if you're using the
dicomServerURL: (optional; default: "dicom-server") to override the path to the DICOM server.- Set to "dicom-server" if you're using the
dicom-serverservice. - Set to "orthanc" if you're using the
orthancservice.
- Set to "dicom-server" if you're using the
- Use
linkFieldsto display a button in the explorer table instead of the study ID as text.
See the portal configuration docs for the latest details.
Submission¶
# depending on whether you use `dicom-server` or `orthanc`:
endpoint = "<Gen3 portal hostname>/dicom-server/instances"
endpoint = "<Gen3 portal hostname>/orthanc/instances"
gen3_access_token = ""
file_path = ""
if not file_path.lower().endswith(".dcm"):
raise Exception(f"'{file_path}' is not a DICOM file")
with open(file_path, "r") as f:
file_contents = f.read()
headers = {
"Content-Type": "Application/DICOM"
"Authorization" = f"Bearer {gen3_access_token}"
}
resp = requests.post(endpoint, data=file_contents, headers=headers)
if resp.status_code != 200:
raise Exception(f"Unable to upload '{file_path}': {resp.status_code} - {resp.text}")
Developer notes¶
- Orthanc: We used the
jodogne/orthancimage when using PostgreSQL for storage, but when switching to AWS S3 storage, we were not able to get it working with this image, so we switched to theosimis/osirisimage. This is why the deployment is different fordicom-server(PostgreSQL) andorthanc(S3). - For
dicom-server, the authorization checks are in our custom authorization filter. - For
orthanc, right now the authorization checks are in revproxy. It should still be possible (and is preferable) to add the custom authorization filter above to this server: docs here. - About authorization granularity
- The authorization is currently at the DICOM study ID level, because that's what the DICOM server receives when a user tries to open a file in the DICOM viewer. This means administrators can grant access at the study level (
resource: "/services/dicom-viewer/studies/<DICOM study ID>") or grant blanket access (either you have access to see all DICOM files in the DICOM viewer, or you don't have access to see any files) (resource: "/services/dicom-viewer/studies"). - Some use cases may require the ability to grant access at a different granularity, such as at the program/project level to match other Gen3 services. Some options to enable this:
- List all the DICOM study IDs in the user.yaml in order to give individual users access to specific studies.
- Update the DICOM server authorization filter to somehow know the mapping of DICOM study ID to Gen3 program and project. The mapping could be hardcoded, queried from the database through Peregrine or Guppy (preferred option), or directly queried from the database by accessing the Sheepdog database.
- Caveat:
dicom-serveruses this filter, butorthancdoesn't. Maybe it could be updated to use the filter (see #3 above).
- Caveat:
- The authorization is currently at the DICOM study ID level, because that's what the DICOM server receives when a user tries to open a file in the DICOM viewer. This means administrators can grant access at the study level (