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

Commit

Permalink
ENH: Refs #0924. Enhanced dicom uploader module with DICOM Query/Retr…
Browse files Browse the repository at this point in the history
…eive services, and rename it as dicom server module.
  • Loading branch information
yuzhengZ committed Jan 21, 2013
1 parent 934fedb commit 8a23fce
Show file tree
Hide file tree
Showing 22 changed files with 1,024 additions and 637 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

class Dicomuploader_AppController extends MIDAS_GlobalModule
class Dicomserver_AppController extends MIDAS_GlobalModule
{
public $moduleName='dicomuploader';
public $moduleName='dicomserver';
} //end class
?>
64 changes: 64 additions & 0 deletions modules/dicomserver/Notification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/*=========================================================================
MIDAS Server
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
69328 Lyon, FRANCE.
See Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

require_once BASE_PATH . '/modules/api/library/APIEnabledNotification.php';

/** notification manager*/
class Dicomserver_Notification extends ApiEnabled_Notification
{
public $_moduleComponents = array('Api', 'Server');
public $moduleName = 'dicomserver';

/** init notification process*/
public function init()
{
$this->enableWebAPI($this->moduleName);
$fc = Zend_Controller_Front::getInstance();
$this->moduleWebroot = $fc->getBaseUrl().'/modules/'.$this->moduleName;
$this->coreWebroot = $fc->getBaseUrl().'/core';
$this->apiWebroot = $fc->getBaseURL().'/modules/api';

$this->addCallBack('CALLBACK_CORE_ITEM_VIEW_ACTIONMENU', 'getItemMenuLink');
$this->addCallBack('CALLBACK_CORE_ITEM_VIEW_JS', 'getJs');
$this->addCallBack('CALLBACK_CORE_GET_DASHBOARD', 'getDashboard');
}//end init

/** Get the link to place in the item action menu */
public function getItemMenuLink($params)
{
$webroot = Zend_Controller_Front::getInstance()->getBaseUrl();
return '<li id="dicomRegisterListItem" style="display: none;">'.
'<a id="dicomRegisterAction" href="#">'.
'<img alt="" src="'.$webroot.'/modules/'.
$this->moduleName.'/public/images/dicom_icon.jpg" /> '.
$this->t('Register Dicom Images').'</a></li>';
}

/** Get javascript for the item view that will specify the ajax call
* for DICOM registration
*/
public function getJs($params)
{
return array($this->moduleWebroot.
'/public/js/item/dicomserver.item.view.js',
$this->apiWebroot.
'/public/js/common/common.ajaxapi.js');
}

/** Add admin dashboard entry for DICOM server */
public function getDashboard()
{
$return = $this->ModuleComponent->Server->isDICOMServerWorking();
return $return;
}//end _getDasboard

} //end class
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; version of the module
version = 1.0.0
; full name
fullname= DICOM Uploader
fullname= DICOM Server
; description
description= Receive and Upload DICOM files
description= Receive and upload DICOM files, also provide DICOM Query/Retrieve services
;Category
category = DICOM
;Dependencies
Expand All @@ -13,6 +13,8 @@ dependencies= api,dicomextractor
;uploader DCMTK command
dcm2xml = "dcm2xml"
storescp = "storescp"
dcmqrscp = "dcmqrscp"
dcmqridx = "dcmqridx"
;uploader reception directory
receptiondir = ""
;storescp configuration
Expand All @@ -21,4 +23,9 @@ storescp_port = "55555"
storescp_study_timeout = "15"
;pydas destnation folder
pydas_dest_folder = "Public"

;dcmqrscp configuration
dcmqrscp_port = "9885"
;server AE title
server_ae_title = "MIDAS_PACS"
;remote AEs
peer_aes = ""
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

// Uploader status
define("MIDAS_DICOM_UPLOADER_IS_RUNNING", "running");
define("MIDAS_DICOM_UPLOADER_NOT_RUNNING", "not running");
define("MIDAS_DICOM_UPLOADER_NOT_SUPPORTED", "This module is currently not supported in Windows.");
// server status
define("MIDAS_DICOM_STORESCP_IS_RUNNING", 1);
define("MIDAS_DICOM_DCMQRSCP_IS_RUNNING", 2);
define("MIDAS_DICOM_SERVER_NOT_RUNNING", 0);
define("MIDAS_DICOM_SERVER_NOT_SUPPORTED", -1);
// default subdirectories and files
define("LOG_DIR", "/logs");
define("PROCESSING_DIR", "/processing");
define("PACS_DIR", "/pacs");
define("DCMQRSCP_CFG_FILE", "/dcmqrscp_midas.cfg");

?>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

class Dicomuploader_ConfigController extends Dicomuploader_AppController
class Dicomserver_ConfigController extends Dicomserver_AppController
{
public $_moduleComponents = array('Uploader');
public $_moduleComponents = array('Server');
public $_moduleForms=array('Config');
public $_components=array('Utility', 'Date');

Expand Down Expand Up @@ -43,14 +43,19 @@ function indexAction()
$applicationConfig['global']['storescp_port']);
$formArray['storescp_study_timeout']->setValue(
$applicationConfig['global']['storescp_study_timeout']);
$formArray['dcmqrscp']->setValue($applicationConfig['global']['dcmqrscp']);
$formArray['dcmqridx']->setValue($applicationConfig['global']['dcmqridx']);
$formArray['dcmqrscp_port']->setValue($applicationConfig['global']['dcmqrscp_port']);
$formArray['server_ae_title']->setValue($applicationConfig['global']['server_ae_title']);
$formArray['peer_aes']->setValue($applicationConfig['global']['peer_aes']);
if(!empty($applicationConfig['global']['receptiondir']))
{
$formArray['receptiondir']->setValue(
$applicationConfig['global']['receptiondir']);
}
else
{
$default_dir = $this->ModuleComponent->Uploader->getDefaultReceptionDir();
$default_dir = $this->ModuleComponent->Server->getDefaultReceptionDir();
$formArray['receptiondir']->setValue($default_dir);
}
$formArray['pydas_dest_folder']->setValue(
Expand Down Expand Up @@ -82,11 +87,21 @@ function indexAction()
$this->_getParam('receptiondir');
$applicationConfig['global']['pydas_dest_folder'] =
$this->_getParam('pydas_dest_folder');
$applicationConfig['global']['dcmqrscp'] =
$this->_getParam('dcmqrscp');
$applicationConfig['global']['dcmqridx'] =
$this->_getParam('dcmqridx');
$applicationConfig['global']['dcmqrscp_port'] =
$this->_getParam('dcmqrscp_port');
$applicationConfig['global']['server_ae_title'] =
$this->_getParam('server_ae_title');
$applicationConfig['global']['peer_aes'] =
$this->_getParam('peer_aes');
$this->Component->Utility->createInitFile(BASE_PATH."/core/configs/".$this->moduleName.".local.ini", $applicationConfig);
echo JsonComponent::encode(array(true, 'Changed saved'));
}
}
$dashboard_array = $this->ModuleComponent->Uploader->isDICOMUploaderWorking();
$dashboard_array = $this->ModuleComponent->Server->isDICOMServerWorking();
// has shown status seperately; remove it from the dashboard to avoid redundancy
unset($dashboard_array['Status']);
$this->view->dashboard = $dashboard_array;
Expand Down
Loading

0 comments on commit 8a23fce

Please sign in to comment.