### Setup Development Environment Source: https://github.com/ohif/viewers/blob/master/platform/core/README.md Instructions for setting up the development environment for @ohif/core. This includes cloning the repository, installing dependencies, starting the development server, and committing changes. ```bash yarn install --frozen-lockfile ``` ```bash yarn run dev ``` ```bash yarn run cm ``` -------------------------------- ### Install Dependencies and Start Local Server Source: https://github.com/ohif/viewers/blob/master/platform/app/README.md Installs project dependencies using Yarn and starts a local development server for the OHIF Viewer. The viewer connects to a public cloud PACS by default. ```bash yarn install --frozen-lockfile yarn start ``` -------------------------------- ### Install Dependencies Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Installs the necessary npm packages for the project. Run this before starting the application. ```bash meteor npm install ``` -------------------------------- ### Install and Start OpenLDAP Server Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Commands to install, configure, and start the OpenLDAP server on a Linux system. ```bash sudo su > yum -y install openldap-servers openldap-clients > cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG > chown ldap. /var/lib/ldap/DB_CONFIG > /etc/rc.d/init.d/slapd start > chkconfig slapd on ``` -------------------------------- ### Start Development Server Source: https://github.com/ohif/viewers/blob/master/AGENTS.md Starts the development server for all packages in the monorepo. Use this for local development. ```bash # Start development server for all packages yarn dev ``` -------------------------------- ### Run OHIFViewer as a Service with PM2 Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Installs PM2 globally and starts the OHIFViewer application as a service for process management. ```bash npm install -g pm2 pm2 start /opt/ohif/bundle/main.js ``` -------------------------------- ### Configure PM2 to Start on Boot Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Sets up PM2 to automatically start the OHIFViewer service when the system boots. ```bash pm2 startup systemd sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u $user--hp /home/$user (NOTE: $user is the user who ran pm2 startup) ``` -------------------------------- ### Start Local Development Server Source: https://github.com/ohif/viewers/blob/master/platform/docs/README.md Starts a local development server for the website. Changes are reflected live without server restarts. ```bash yarn start ``` -------------------------------- ### Install Production Server Dependencies Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Navigates into the built application bundle and installs Node.js dependencies for the server. ```bash cd ohif/bundle/ cd programs/server/ npm install ``` -------------------------------- ### Install Production NPM Packages Source: https://github.com/ohif/viewers/wiki/Building-for-Production Run this command in the viewer folder to install only production-ready NPM packages. ```bash npm install --production ``` -------------------------------- ### Configure and Run OHIFViewer Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Sets environment variables for MongoDB URL, root URL, and port, then starts the OHIFViewer application. ```bash cd ../.. export MONGO_URL=mongodb://localhost:27017/myapp export ROOT_URL=http://10.130.0.90:3000 (!NOTE: in case that you use FQDN you should replace the url to: http://FQDN:3000) export PORT=3000 cd opt/ohif/bundle/ node main.js & ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/ohif/viewers/blob/master/platform/docs/README.md Installs project dependencies using yarn. Use this command to set up the project environment. ```bash yarn install --frozen-lockfile ``` -------------------------------- ### WildFly Bootstrap Environment Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Example output showing the WildFly bootstrap environment and Java options. This is part of the startup log. ```text ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: wildfly-11.0.0.Final JAVA: java JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true ========================================================================= : 09:22:54,094 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final) started in 28397ms - Started 1839 of 2270 services (683 services are lazy, passive or on-demand) ``` -------------------------------- ### Install OHIFViewer Application Dependencies Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Installs production dependencies for the OHIFViewer application and sets environment variables for Meteor. ```bash cd /opt/Viewers/OHIFViewer/ npm install --production export METEOR_PACKAGE_DIRS="/opt/Viewers/Packages/" export METEOR_SETTINGS=$(cat /opt/Viewers/config/orthancDICOMWeb.json) ``` -------------------------------- ### Install meteor-build-client Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Installs the meteor-build-client tool globally. This tool is required to build the standalone viewer into a client-only bundle. ```bash sudo npm install -g meteor-build-client ``` -------------------------------- ### Run Keycloak Install Script Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Executes the keycloak-install.cli script from the WildFly bin directory to add the Keycloak adapter to the WildFly server configuration. ```bash jboss-cli.sh --file=keycloak-install.cli ``` -------------------------------- ### Install QueryDSL JBoss Module Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the QueryDSL 4.1.4 libraries as a JBoss module. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/querydsl-jboss-modules-4.1.4-noguava.zip ``` -------------------------------- ### Prepare MongoDB Data Directory Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Creates a directory for MongoDB data and starts the MongoDB server in the background. ```bash cd / mkdir /data cd data/ mkdir db mongod & ``` -------------------------------- ### Start Orthanc Docker (Temporary Storage) Source: https://github.com/ohif/viewers/wiki/Orthanc-with-Docker-Usage Use this command to start an Orthanc Docker instance with temporary data storage. All data will be removed when the instance is stopped. ```bash docker run --rm -p 4242:4242 -p 8042:8042 jodogne/orthanc-plugins ``` -------------------------------- ### Install Keycloak Adapter Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the Keycloak adapter for WildFly using the adapter-elytron-install.cli script. This command is run with an active connection to the WildFly server. ```bash > $WILDFLY_HOME/bin/jboss-cli.sh -c --file=adapter-elytron-install.cli ``` -------------------------------- ### Install JAI Image IO JBoss Module Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the JAI Image IO 1.2 libraries as a JBoss module. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/jai_imageio-jboss-modules-1.2-pre-dr-b04.zip ``` -------------------------------- ### Start WildFly with DCM4CHEE Configuration Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Starts WildFly in standalone mode using the custom dcm4chee-arc.xml configuration file. Monitor the console output for successful startup. ```bash $WILDFLY_HOME/bin/standalone.sh -c dcm4chee-arc.xml ``` -------------------------------- ### Enable Yarn Workspaces and Install Dependencies Source: https://github.com/ohif/viewers/blob/master/README.md Run these commands from the root directory to configure Yarn Workspaces and restore project dependencies. ```bash yarn config set workspaces-experimental true ``` ```bash yarn install --frozen-lockfile ``` -------------------------------- ### Install ecs-object-client JBoss Module Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the ecs-object-client 3.0.0 libraries as JBoss modules. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/ecs-object-client-jboss-modules-3.0.0.zip ``` -------------------------------- ### Run Simple Python Server for Testing Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Starts a simple Python HTTP server that redirects all requests to index.html, useful for testing the bundled client-side application. ```bash python ../etc/redirectingSimpleServer.py ``` -------------------------------- ### Install @ohif/core with npm or yarn Source: https://github.com/ohif/viewers/blob/master/platform/core/README.md Install the @ohif/core library using npm or yarn. It is recommended to use an exact version to prevent potential breaking changes in pre-v1.0 releases. ```bash npm i @ohif/core --save-exact ``` ```bash yarn add @ohif/core --exact ``` -------------------------------- ### Install NPM Dependencies in Bundle Source: https://github.com/ohif/viewers/wiki/Building-for-Production After the build process, navigate to the server directory within the bundle and install the necessary NPM dependencies for the production environment. ```bash cd myOutputFolder/bundle cd programs/server npm install ``` -------------------------------- ### Install DCM4CHE JBoss Modules Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the DCM4CHE libraries as JBoss modules by unzipping the provided archive. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/dcm4che-jboss-modules-5.11.0.zip ``` -------------------------------- ### Install OHIF Viewer Requirements Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Installs essential packages for running the OHIF Viewer, including Node.js, MongoDB, and Meteor. ```bash apt-get install nodejs-legacy apt-get install nodejs apt-get install mongodb apt-get install npm curl https://install.meteor.com/ | sh ``` -------------------------------- ### Start DCM4CHEE Docker Containers Source: https://github.com/ohif/viewers/wiki/DCM4CHEE-with-Docker-Usage Use this command to start the DCM4CHEE services managed by Docker Compose. Ensure you have created the docker-compose.yml and docker-compose.env files beforehand. ```bash docker-compose start ``` -------------------------------- ### Run Production Build (Windows CMD) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Starts the OHIF Viewer in production mode on Windows Command Prompt. Ensure MongoDB is running and set the correct environment variables for MONGO_URL, ROOT_URL, and PORT. ```cmd SET MONGO_URL=mongodb://localhost:27017/myapp SET ROOT_URL=http://localhost SET PORT=3000 node main.js ``` -------------------------------- ### Run the Standalone Viewer Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Starts the standalone viewer application locally. Ensure METEOR_PACKAGE_DIRS is set correctly to point to your packages. ```bash METEOR_PACKAGE_DIRS="../../Packages" meteor ``` -------------------------------- ### Install JDBC Driver for MySQL Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the JDBC Driver for MySQL as a JBoss module and copies the driver JAR to the correct location. Verify the JAR file name matches the module.xml. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/jdbc-jboss-modules-1.0.0-mysql.zip > cp mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar modules/com/mysql/main/ ``` -------------------------------- ### Run Production Build (Non-Windows) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Starts the OHIF Viewer in production mode on non-Windows systems. Ensure MongoDB is running and set the correct environment variables for MONGO_URL, ROOT_URL, and PORT. ```bash MONGO_URL=mongodb://localhost:27017/myapp ROOT_URL=http://localhost PORT=3000 node main.js ``` -------------------------------- ### Copy Configuration Files Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Copies the DCM4CHEE configuration files into the WildFly installation directory. Ensure LDAP connection and TLS specific values are configured in ldap.properties. ```bash cp -r $DCM4CHEE_ARC/configuration/dcm4chee-arc $WILDFLY_HOME/standalone/configuration ``` -------------------------------- ### Clone OHIF Viewers Repository Source: https://github.com/ohif/viewers/blob/master/README.md Clone your forked repository to start development. Ensure you have a GitHub account and have forked the repository first. ```bash git clone https://github.com/YOUR-USERNAME/Viewers.git ``` -------------------------------- ### Run Orthanc Container with Persistent Storage Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Starts an Orthanc Docker container configured as a DICOMweb server with persistent storage mapped to a host directory. ```bash mount -t cifs //${IP_address}/${folder} /images -o username=${username},password=${password} docker run -d -P --name ohif -p 4242:4242 -p 8042:8042 -v /images:/var/lib/orthanc/db jodogne/orthanc-plugins ``` -------------------------------- ### Run OHIF Viewer with DCM4CHEE DIMSE Configuration Source: https://github.com/ohif/viewers/wiki/Getting-Started Use this command to run the OHIF Viewer application configured for DCM4CHEE and DIMSE. Ensure Meteor is installed and the Viewers repository is cloned. ```bash METEOR_PACKAGE_DIRS="../Packages" meteor --settings ../config/dcm4cheeDIMSE.json ``` -------------------------------- ### Run Orthanc Docker with Persistent Volume Source: https://github.com/ohif/viewers/wiki/Orthanc-with-Docker-Usage Start an Orthanc Docker instance and attach the previously created persistent data volume. Data uploaded will be persisted after the instance is stopped. ```bash docker run --volumes-from sampledata -p 4242:4242 -p 8042:8042 jodogne/orthanc-plugins ``` -------------------------------- ### Run OHIF Viewer with Orthanc DIMSE Configuration Source: https://github.com/ohif/viewers/wiki/Getting-Started Use this command to run the OHIF Viewer application configured for Orthanc and DIMSE. Ensure Meteor is installed and the Viewers repository is cloned. ```bash METEOR_PACKAGE_DIRS="../Packages" meteor --settings ../config/orthancDIMSE.json ``` -------------------------------- ### Run OHIF Viewer with Orthanc DICOMWeb Configuration Source: https://github.com/ohif/viewers/wiki/Getting-Started Use this command to run the OHIF Viewer application configured for Orthanc and DICOMWeb. Ensure Meteor is installed and the Viewers repository is cloned. ```bash METEOR_PACKAGE_DIRS="../Packages" meteor --settings ../config/orthancDICOMWeb.json ``` -------------------------------- ### MySQL JDBC Driver Module Configuration Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Example XML configuration for the MySQL JDBC driver module. Ensure the resource-root path matches the actual JAR file name. ```xml ``` -------------------------------- ### Create and Enable Data Source using JBoss CLI Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Creates and enables a new data source named 'PacsDS' using JBoss CLI. Configure the connection URL, JNDI name, username, and password according to your MySQL setup. ```bash [standalone@localhost:9990 /] data-source add --name=PacsDS \ > --driver-name=mysql \ > --connection-url=jdbc:mysql://:3306/\ > --jndi-name=java:/PacsDS \ > --user-name= \ > --password= [standalone@localhost:9990 /] data-source enable --name=PacsDS ``` -------------------------------- ### Install jclouds JBoss Module Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Installs the jclouds 2.0.2 libraries as JBoss modules. ```bash > cd $WILDFLY_HOME > unzip $DCM4CHEE_ARC/jboss-modules/jclouds-jboss-modules-2.0.2-noguava.zip ``` -------------------------------- ### Create API Folder and Copy Data Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Prepares the output folder for testing by creating an 'api' directory and copying sample data into it. ```bash cd myOutputFolder mkdir api ``` ```bash cp ../etc/sample* api/ ``` -------------------------------- ### Initialize MySQL Database Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Commands to create a database and grant access to a user in MySQL. ```sql mysql -u root -p mysql> create database ; mysql> create user ''@localhost identified by '' mysql> grant all on .* to '' identified by ''; mysql> quit ``` -------------------------------- ### Test Pre-built Client-Only Build Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Runs a pre-built client-only version of the standalone viewer using a simple Python server. Navigate to http://localhost:3000/sampleJPEG.json or http://localhost:3000/sampleDICOM.json to test. ```bash cd SampleClientOnlyBuild python ../etc/redirectingSimpleServer.py ``` -------------------------------- ### Build Client Bundle Source: https://github.com/ohif/viewers/wiki/Running-and-building-the-Standalone-Viewer Builds the standalone viewer into a client-only bundle. Specify an output folder and the base URL where the viewer will be hosted. ```bash METEOR_PACKAGE_DIRS="../../Packages" meteor-build-client myOutputFolder -u localhost:3000 ``` -------------------------------- ### Build Specific Package Source: https://github.com/ohif/viewers/blob/master/AGENTS.md Builds a specific package for production. Navigate to the package directory first, then run the build command. ```bash # Build specific packages cd platform/app && yarn build # Main viewer app ``` -------------------------------- ### Modify Keycloak Install Script Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Updates the embed-server configuration in the keycloak-install.cli script to use the custom dcm4chee-arc.xml instead of the default standalone.xml. ```bash embed-server --server-config=standalone.xml To embed-server --server-config=dcm4chee-arc.xml ``` -------------------------------- ### Deploy Website to GitHub Pages Source: https://github.com/ohif/viewers/blob/master/platform/docs/README.md Builds the website and pushes it to the 'gh-pages' branch, suitable for GitHub Pages hosting. Ensure you replace '' with your actual username. ```bash GIT_USER= USE_SSH=true yarn deploy ``` -------------------------------- ### Build OHIFViewer Application Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Builds the OHIFViewer application using Meteor. The --allow-superuser flag is mandatory if running as root. ```bash cd /opt mkdir ohif meteor build --directory /opt/ohif/ --allow-superuser ``` -------------------------------- ### Keycloak Admin Login Credentials Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Provides the default URL and credentials for logging into the Keycloak admin console. These are used for initial setup and user/realm creation. ```text http://localhost:8080/auth User/Password : admin/admin ``` -------------------------------- ### Create and Mount External Share for Images Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Sets up a directory and mounts an external CIFS share to persist DICOM images. ```bash cd /mnt/ mkdir images mount -t cifs //IPAddres/Path images/ -o username=X,password=X ``` -------------------------------- ### Run OHIF Viewer with DCM4CHEE Configuration Source: https://github.com/ohif/viewers/wiki/DCM4CHEE-with-Docker-Usage Navigate to the OHIFViewer directory and run the Meteor application using the specified settings file for DCM4CHEE integration. This command assumes you are in the root directory of the project and the configuration files are in the correct relative paths. ```bash cd OHIFViewer PACKAGE_DIRS="../Packages" meteor --settings ../config/dcm4cheeDIMSE.json ``` -------------------------------- ### Run prepare-markdown-files Script Source: https://github.com/ohif/viewers/blob/master/platform/docs/scripts/README.md Manually run the script to copy markdown files to the /llm directory. This makes raw markdown content available for LLM tools. ```bash cd platform/docs yarn run prepare-markdown-files ``` -------------------------------- ### Test File Naming Convention Source: https://github.com/ohif/viewers/blob/master/platform/core/README.md When writing tests for @ohif/core, place the test file directly next to the file it is testing. For example, a test for index.js should be named index.test.js. ```javascript // File index.js; // Test for file index.test.js; ``` -------------------------------- ### Build OHIF Viewer (Windows CMD, Manual Config) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Builds the OHIF Viewer for production on Windows Command Prompt without pre-configuring DICOM server information. This information will need to be added manually when running the build. ```cmd SET METEOR_PACKAGE_DIRS="../Packages" meteor build --directory myOutputFolder ``` -------------------------------- ### Build OHIF Viewer (Windows, Automatic Config) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Builds the OHIF Viewer for production on Windows using PowerShell, automatically configuring it with the Orthanc DICOM Web server settings. This requires running PowerShell as an administrator. ```powershell Start-Process powershell -Verb runAs cd OHIFViewerFolderLocation $settings = Get-Content ..\config\orthancDICOMWeb.json -Raw $settings = $settings -replace "`n","" -replace "`r","" -replace " ","" [Environment]::SetEnvironmentVariable("METEOR_SETTINGS", $settings, "Machine") SET METEOR_PACKAGE_DIRS="../Packages" meteor build --directory myOutputFolder ``` -------------------------------- ### Create MySQL Tables and Indexes Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Command to create tables and indexes in the MySQL database using a provided SQL script. ```bash mysql -u -p < $DCM4CHEE_ARC/sql/create-mysql.sql ``` -------------------------------- ### Build OHIF Viewer (Non-Windows, Automatic Config) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Builds the OHIF Viewer for production, automatically configuring it with the Orthanc DICOM Web server settings. Ensure you are in the viewer directory. ```bash METEOR_PACKAGE_DIRS="../Packages" METEOR_SETTINGS=$(cat ../config/orthancDICOMWeb.json) meteor build --directory myOutputFolder ``` -------------------------------- ### Clone OHIFViewer Repository Source: https://github.com/ohif/viewers/wiki/OHIFViewer-install-in-Ubuntu-14-and-above Downloads the OHIF Viewer source code from GitHub. ```bash cd /opt git clone https://github.com/OHIF/Viewers cd Viewers ``` -------------------------------- ### Build Static Website Content Source: https://github.com/ohif/viewers/blob/master/platform/docs/README.md Generates static content for the website into the 'build' directory. This content can be hosted on any static hosting service. ```bash yarn build ``` -------------------------------- ### Build OHIF Viewer (Non-Windows, Manual Config) Source: https://github.com/ohif/viewers/wiki/Building-for-Production Builds the OHIF Viewer for production without pre-configuring DICOM server information. This information will need to be added manually when running the build. ```bash METEOR_PACKAGE_DIRS="../Packages" meteor build --directory myOutputFolder ``` -------------------------------- ### Build All Production Packages Source: https://github.com/ohif/viewers/blob/master/AGENTS.md Builds all packages within the monorepo for production deployment. This command optimizes and bundles all components. ```bash # Build all packages for production yarn build ``` -------------------------------- ### Copy WildFly Configuration Source: https://github.com/ohif/viewers/wiki/Installation-of-DCM4CHEE Copies the WildFly Java EE 7 Full Profile configuration to be used as a base for DCM4CHEE. ```bash > cd $WILDFLY_HOME/standalone/configuration/ > cp standalone-full.xml dcm4chee-arc.xml ```