is there a functionality in orthanc dicom server to set paths for dicom files to me stored at
Assistant
Orthanc is an open-source, lightweight DICOM server for healthcare and medical research. In Orthanc, you can configure the storage paths for DICOM files by editing the configuration file. The configuration file is typically named orthanc.json and is often located in the directory where Orthanc is installed, or in a specific configuration directory, depending on the operating system and installation method.
User
how to run 2 orthanc instances on the same server
Assistant
User
how to start secon instance on windows
Assistant
Here are the steps to set the storage paths for DICOM files in Orthanc:
Locate the orthanc.json configuration file on your system.
Open orthanc.json in a text editor with sufficient permission to modify the file.
Find or add the StorageDirectory entry under the "Orthanc" section. This entry defines the path where DICOM files will be stored:
json
{
"Orthanc": {
"StorageDirectory": "/path/to/your/storage/directory",
// ... other configuration options
}
// ... other sections like "DicomWeb", "Plugins", etc
}
Replace "/path/to/your/storage/directory" with the actual directory path where you want Orthanc to store the DICOM files.
Optionally, you can also set the IndexDirectory key to define where Orthanc stores its SQLite database and related indexing files:
json
{
"Orthanc": {
"StorageDirectory": "/path/to/your/storage/directory",
"IndexDirectory": "/path/to/your/index/directory",
// ... other configuration options
}
// ... other sections like "DicomWeb", "Plugins", etc
}
Save and close the orthanc.json file after you have finished editing it.
Restart the Orthanc server to apply the changes. The way to restart the service may vary depending on how Orthanc is run (e.g., as a system service, using a command in a terminal, using Docker, etc.).
For example, on a Linux-based system, if Orthanc is installed as a service, you might restart it with a command like:
code
sudo service orthanc restart
Or, if you're using systemd:
code
sudo systemctl restart orthanc
Make sure you have proper permissions for Orthanc to read and write in the specified directories. Additionally, back up any important data before making configuration changes, and carefully test the configuration after you restart the server to ensure everything is working as expected.
To run two instances of Orthanc on the same server, you need to ensure that each instance has its own unique configuration, including separate storage directories, databases, and network ports. Follow these steps to set up two Orthanc instances:
Install Orthanc: If you haven't installed Orthanc on your server yet, you'll need to install it. You can download it from the official Orthanc website or install it through package managers on systems like Ubuntu using sudo apt install orthanc.
Duplicate Configuration: Make a copy of the original Orthanc configuration file (orthanc.json) and name it differently for the second instance (e.g., orthanc2.json). If using default locations, you might find the original configuration file at /etc/orthanc/.
Modify Configurations: Edit both configuration files to ensure the following are unique for each instance:
StorageDirectory: A file system path to the folder where DICOM files for that instance should be stored.
IndexDirectory: A file system path to the folder where the database index for that instance should be stored.
DicomServerPort: A TCP/IP port number for DICOM communications (ensure they are different for each instance).
HttpServerPort: A TCP/IP port number for web server communications (this is for HTTP requests and should be different for each instance).
Example Configuration Changes:
For the first instance (orthanc.json), keep the defaults or set as you desire:
Run Multiple Instances: You can start the Orthanc server with a specific configuration file by passing the path to the configuration file as an argument.
For instance 1:
bash
Orthanc /etc/orthanc/orthanc.json
For instance 2:
bash
Orthanc /etc/orthanc/orthanc2.json
As Services: If you need the instances to run as services, you may need to create separate service configuration files (e.g., for systemd). Duplicate the existing service file, for example /lib/systemd/system/orthanc.service, to create a new file like /lib/systemd/system/orthanc2.service. Modify the ExecStart line in the new service file to point to the second configuration file:
Verify: Use a web browser or a DICOM client to verify that each instance is running correctly and is accessible on the configured HTTP and DICOM ports.
Remember that each instance will have its own REST API endpoint and DICOM configuration, so you will need to manage them separately. Consider also the resource allocation as running multiple instances on the same server will demand more CPU, memory, and disk resources.
Running a second instance of Orthanc on Windows involves creating a separate configuration file for the new instance, just like on Linux, and then starting Orthanc with this new configuration. Here are the detailed steps:
Locate the Configuration File: Find the original configuration file for Orthanc, which is typically orthanc.json. The location can vary depending on how you installed Orthanc.
Create a New Configuration: Make a copy of orthanc.json and name it orthanc2.json. Place this file in a directory where you want to manage your second Orthanc instance's configuration.
Edit the New Configuration: Open orthanc2.json in a text editor. Ensure that the following keys are set to unique values different from the first instance:
Make sure to create the directories you set for StorageDirectory and IndexDirectory if they do not already exist.
Start the Second Instance: Open a command prompt or PowerShell window. Navigate to the directory where Orthanc is installed, which is likely to be something like C:\Program Files\Orthanc Server\ or the path where you have extracted Orthanc if it was downloaded as a ZIP file.
Start the first instance (if not already running) with the original configuration:
powershell
Orthanc.exe "C:\path\to\orthanc.json"
Open another command prompt or PowerShell window and start the second instance with the new configuration:
powershell
Orthanc.exe "C:\path\to\orthanc2.json"
Verify the Instances: Open your web browser and navigate to http://localhost:8042/ for the first instance and http://localhost:8043/ for the second instance (or whatever HTTP ports you have configured) to confirm that both Orthanc instances are running.
Run as Windows Services: If you want to have your Orthanc instances run as Windows services, you would need to create separate Windows service entries for each instance. This typically requires using a service wrapper or a tool like NSSM (the Non-Sucking Service Manager) to install and manage multiple instances of Orthanc as services with individual configurations.
Managing Instances: Each Orthanc instance must be managed separately. You can administer each instance using their individual web interfaces or REST API endpoints on their respective ports.
Remember to configure your firewall to allow traffic on the new HTTP and DICOM ports if needed, and ensure the system has sufficient resources to handle multiple instances.