Skip to content

Commit

Permalink
Added configuration option to enable acceptance of all DICOM transfer…
Browse files Browse the repository at this point in the history
… syntaxes
  • Loading branch information
tblock79 committed Feb 24, 2022
1 parent e601886 commit 28a2386
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
mercure_defaults = {
"appliance_name": "master",
"port": 11112,
"accept_compressed_images": "False",
"incoming_folder": "/opt/mercure/data/incoming",
"studies_folder": "/opt/mercure/data/studies",
"outgoing_folder": "/opt/mercure/data/outgoing",
Expand Down
1 change: 1 addition & 0 deletions common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Rule(BaseModel, Compat):
class Config(BaseModel, Compat):
appliance_name: str
port: int
accept_compressed_images: str
incoming_folder: str
studies_folder: str
outgoing_folder: str
Expand Down
1 change: 1 addition & 0 deletions configuration/default_mercure.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"appliance_name" : "master",
"port" : 11112,
"accept_compressed_images" : "False",
"incoming_folder" : "/opt/mercure/data/incoming",
"studies_folder" : "/opt/mercure/data/studies",
"outgoing_folder" : "/opt/mercure/data/outgoing",
Expand Down
10 changes: 9 additions & 1 deletion receiver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi
incoming=$(cat $config | jq -r '.incoming_folder')
port=$(cat $config | jq '.port')
bookkeeper=$(cat $config | jq -r '.bookkeeper')
accept_compressed=$(cat $config | jq -r '.accept_compressed_images')

# Check if incoming folder exists
if [ ! -d "$incoming" ]; then
Expand Down Expand Up @@ -65,6 +66,13 @@ else
bookkeeper=" $bookkeeper"
fi

transfer_syntax_option=""
if [ $accept_compressed = "True" ]
then
echo "NOTE: Accepting all supported transfer syntaxes"
transfer_syntax_option="+xa"
fi

echo ""
echo "Starting receiver process on port $port, folder $incoming, bookeeper $bookkeeper"
storescp --fork --promiscuous -od "$incoming" +uf -xcr "$binary $incoming/#f #a #c$bookkeeper" $port
storescp --fork --promiscuous $transfer_syntax_option -od "$incoming" +uf -xcr "$binary $incoming/#f #a #c$bookkeeper" $port
20 changes: 14 additions & 6 deletions webinterface/templates/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1 class="title">Configuration</h1>
<h5 class="title is-5 configtitle"><i class="fas fa-server has-text-success"></i>&nbsp;&nbsp;General
</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>Operating System:</td>
<td>{{os_string}}</td>
Expand All @@ -37,6 +37,14 @@ <h5 class="title is-5 configtitle"><i class="fas fa-server has-text-success"></i
<td>DICOM Port:</td>
<td>{{config['port']}}</td>
</tr>
<tr>
<td>Accept Compressed Images:</td>
<td>{{config['accept_compressed_images']}}
{% if config['accept_compressed_images']=='True' %}
<a href="https://mercure-imaging.org/docs/advanced.html" target="_blank" title="This setting can be problematic. Carefully read the documentation"><i class="fas fa-exclamation-circle has-text-warning" style="margin-left: 1px;"></i></a>
{% endif %}
</td>
</tr>
</table>
</div>
</div>
Expand All @@ -45,7 +53,7 @@ <h5 class="title is-5 configtitle"><i class="fas fa-server has-text-success"></i
<h5 class="title is-5 configtitle"><i
class="fas fa-exclamation-triangle has-text-success"></i>&nbsp;&nbsp;Error Handling</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>Retry Delay:</td>
<td>{{config['retry_delay']}} sec</td>
Expand All @@ -62,7 +70,7 @@ <h5 class="title is-5 configtitle"><i
<h5 class="title is-5 configtitle"><i
class="fas fa-bullhorn has-text-success"></i>&nbsp;&nbsp;Monitoring</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>Bookkeeper:</td>
<td>{{config['bookkeeper']}}</td>
Expand All @@ -83,7 +91,7 @@ <h5 class="title is-5 configtitle"><i
<h5 class="title is-5 configtitle"><i class="fas fa-bed has-text-success"></i>&nbsp;&nbsp;Off-Peak Hours
</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>From:</td>
<td>{{config['offpeak_start']}}</td>
Expand All @@ -100,7 +108,7 @@ <h5 class="title is-5 configtitle"><i class="fas fa-bed has-text-success"></i>&n
<h5 class="title is-5 configtitle"><i
class="fas fa-hourglass-end has-text-success"></i>&nbsp;&nbsp;Thresholds</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>Series Completion:</td>
<td>{{config['series_complete_trigger']}} sec</td>
Expand Down Expand Up @@ -137,7 +145,7 @@ <h5 class="title is-5 configtitle"><i
<h5 class="title is-5 configtitle"><i
class="fas fa-folder-open has-text-success"></i>&nbsp;&nbsp;Folders</h5>
<table class="table is-narrow is-hoverable is-fullwidth configtable">
<col width="200px">
<col width="230px">
<tr>
<td>Incoming:</td>
<td>{{config['incoming_folder']}}</td>
Expand Down

0 comments on commit 28a2386

Please sign in to comment.