Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 8a23fce

Browse files
committed
ENH: Refs #0924. Enhanced dicom uploader module with DICOM Query/Retreive services, and rename it as dicom server module.
1 parent 934fedb commit 8a23fce

File tree

22 files changed

+1024
-637
lines changed

22 files changed

+1024
-637
lines changed

modules/dicomuploader/AppController.php renamed to modules/dicomserver/AppController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
PURPOSE. See the above copyright notices for more information.
1111
=========================================================================*/
1212

13-
class Dicomuploader_AppController extends MIDAS_GlobalModule
13+
class Dicomserver_AppController extends MIDAS_GlobalModule
1414
{
15-
public $moduleName='dicomuploader';
15+
public $moduleName='dicomserver';
1616
} //end class
1717
?>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5+
69328 Lyon, FRANCE.
6+
7+
See Copyright.txt for details.
8+
This software is distributed WITHOUT ANY WARRANTY; without even
9+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10+
PURPOSE. See the above copyright notices for more information.
11+
=========================================================================*/
12+
13+
require_once BASE_PATH . '/modules/api/library/APIEnabledNotification.php';
14+
15+
/** notification manager*/
16+
class Dicomserver_Notification extends ApiEnabled_Notification
17+
{
18+
public $_moduleComponents = array('Api', 'Server');
19+
public $moduleName = 'dicomserver';
20+
21+
/** init notification process*/
22+
public function init()
23+
{
24+
$this->enableWebAPI($this->moduleName);
25+
$fc = Zend_Controller_Front::getInstance();
26+
$this->moduleWebroot = $fc->getBaseUrl().'/modules/'.$this->moduleName;
27+
$this->coreWebroot = $fc->getBaseUrl().'/core';
28+
$this->apiWebroot = $fc->getBaseURL().'/modules/api';
29+
30+
$this->addCallBack('CALLBACK_CORE_ITEM_VIEW_ACTIONMENU', 'getItemMenuLink');
31+
$this->addCallBack('CALLBACK_CORE_ITEM_VIEW_JS', 'getJs');
32+
$this->addCallBack('CALLBACK_CORE_GET_DASHBOARD', 'getDashboard');
33+
}//end init
34+
35+
/** Get the link to place in the item action menu */
36+
public function getItemMenuLink($params)
37+
{
38+
$webroot = Zend_Controller_Front::getInstance()->getBaseUrl();
39+
return '<li id="dicomRegisterListItem" style="display: none;">'.
40+
'<a id="dicomRegisterAction" href="#">'.
41+
'<img alt="" src="'.$webroot.'/modules/'.
42+
$this->moduleName.'/public/images/dicom_icon.jpg" /> '.
43+
$this->t('Register Dicom Images').'</a></li>';
44+
}
45+
46+
/** Get javascript for the item view that will specify the ajax call
47+
* for DICOM registration
48+
*/
49+
public function getJs($params)
50+
{
51+
return array($this->moduleWebroot.
52+
'/public/js/item/dicomserver.item.view.js',
53+
$this->apiWebroot.
54+
'/public/js/common/common.ajaxapi.js');
55+
}
56+
57+
/** Add admin dashboard entry for DICOM server */
58+
public function getDashboard()
59+
{
60+
$return = $this->ModuleComponent->Server->isDICOMServerWorking();
61+
return $return;
62+
}//end _getDasboard
63+
64+
} //end class
File renamed without changes.

modules/dicomuploader/configs/module.ini renamed to modules/dicomserver/configs/module.ini

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
; version of the module
33
version = 1.0.0
44
; full name
5-
fullname= DICOM Uploader
5+
fullname= DICOM Server
66
; description
7-
description= Receive and Upload DICOM files
7+
description= Receive and upload DICOM files, also provide DICOM Query/Retrieve services
88
;Category
99
category = DICOM
1010
;Dependencies
@@ -13,6 +13,8 @@ dependencies= api,dicomextractor
1313
;uploader DCMTK command
1414
dcm2xml = "dcm2xml"
1515
storescp = "storescp"
16+
dcmqrscp = "dcmqrscp"
17+
dcmqridx = "dcmqridx"
1618
;uploader reception directory
1719
receptiondir = ""
1820
;storescp configuration
@@ -21,4 +23,9 @@ storescp_port = "55555"
2123
storescp_study_timeout = "15"
2224
;pydas destnation folder
2325
pydas_dest_folder = "Public"
24-
26+
;dcmqrscp configuration
27+
dcmqrscp_port = "9885"
28+
;server AE title
29+
server_ae_title = "MIDAS_PACS"
30+
;remote AEs
31+
peer_aes = ""

modules/dicomuploader/constant/module.php renamed to modules/dicomserver/constant/module.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
PURPOSE. See the above copyright notices for more information.
1111
=========================================================================*/
1212

13-
// Uploader status
14-
define("MIDAS_DICOM_UPLOADER_IS_RUNNING", "running");
15-
define("MIDAS_DICOM_UPLOADER_NOT_RUNNING", "not running");
16-
define("MIDAS_DICOM_UPLOADER_NOT_SUPPORTED", "This module is currently not supported in Windows.");
13+
// server status
14+
define("MIDAS_DICOM_STORESCP_IS_RUNNING", 1);
15+
define("MIDAS_DICOM_DCMQRSCP_IS_RUNNING", 2);
16+
define("MIDAS_DICOM_SERVER_NOT_RUNNING", 0);
17+
define("MIDAS_DICOM_SERVER_NOT_SUPPORTED", -1);
18+
// default subdirectories and files
19+
define("LOG_DIR", "/logs");
20+
define("PROCESSING_DIR", "/processing");
21+
define("PACS_DIR", "/pacs");
22+
define("DCMQRSCP_CFG_FILE", "/dcmqrscp_midas.cfg");
1723

1824
?>

modules/dicomuploader/controllers/ConfigController.php renamed to modules/dicomserver/controllers/ConfigController.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
PURPOSE. See the above copyright notices for more information.
1111
=========================================================================*/
1212

13-
class Dicomuploader_ConfigController extends Dicomuploader_AppController
13+
class Dicomserver_ConfigController extends Dicomserver_AppController
1414
{
15-
public $_moduleComponents = array('Uploader');
15+
public $_moduleComponents = array('Server');
1616
public $_moduleForms=array('Config');
1717
public $_components=array('Utility', 'Date');
1818

@@ -43,14 +43,19 @@ function indexAction()
4343
$applicationConfig['global']['storescp_port']);
4444
$formArray['storescp_study_timeout']->setValue(
4545
$applicationConfig['global']['storescp_study_timeout']);
46+
$formArray['dcmqrscp']->setValue($applicationConfig['global']['dcmqrscp']);
47+
$formArray['dcmqridx']->setValue($applicationConfig['global']['dcmqridx']);
48+
$formArray['dcmqrscp_port']->setValue($applicationConfig['global']['dcmqrscp_port']);
49+
$formArray['server_ae_title']->setValue($applicationConfig['global']['server_ae_title']);
50+
$formArray['peer_aes']->setValue($applicationConfig['global']['peer_aes']);
4651
if(!empty($applicationConfig['global']['receptiondir']))
4752
{
4853
$formArray['receptiondir']->setValue(
4954
$applicationConfig['global']['receptiondir']);
5055
}
5156
else
5257
{
53-
$default_dir = $this->ModuleComponent->Uploader->getDefaultReceptionDir();
58+
$default_dir = $this->ModuleComponent->Server->getDefaultReceptionDir();
5459
$formArray['receptiondir']->setValue($default_dir);
5560
}
5661
$formArray['pydas_dest_folder']->setValue(
@@ -82,11 +87,21 @@ function indexAction()
8287
$this->_getParam('receptiondir');
8388
$applicationConfig['global']['pydas_dest_folder'] =
8489
$this->_getParam('pydas_dest_folder');
90+
$applicationConfig['global']['dcmqrscp'] =
91+
$this->_getParam('dcmqrscp');
92+
$applicationConfig['global']['dcmqridx'] =
93+
$this->_getParam('dcmqridx');
94+
$applicationConfig['global']['dcmqrscp_port'] =
95+
$this->_getParam('dcmqrscp_port');
96+
$applicationConfig['global']['server_ae_title'] =
97+
$this->_getParam('server_ae_title');
98+
$applicationConfig['global']['peer_aes'] =
99+
$this->_getParam('peer_aes');
85100
$this->Component->Utility->createInitFile(BASE_PATH."/core/configs/".$this->moduleName.".local.ini", $applicationConfig);
86101
echo JsonComponent::encode(array(true, 'Changed saved'));
87102
}
88103
}
89-
$dashboard_array = $this->ModuleComponent->Uploader->isDICOMUploaderWorking();
104+
$dashboard_array = $this->ModuleComponent->Server->isDICOMServerWorking();
90105
// has shown status seperately; remove it from the dashboard to avoid redundancy
91106
unset($dashboard_array['Status']);
92107
$this->view->dashboard = $dashboard_array;

0 commit comments

Comments
 (0)