| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- header('Content-Type:text/xml');
- error_log('test');
- ?>
- <?php
- define("DIR_DICOM_FS", getcwd() . "/");
-
- $pixelSpacingX = 0;
- $pixelSpacingY = 0;
- $physicalDeltaX = 0;
- $physicalDeltaY = 0;
-
- $filename = $_GET["filename"];
-
- $fname = DIR_DICOM_FS . 'upload/' . $filename;
- $fname = str_replace("'", "_",$fname);
-
- exec('dcmconv.exe -i "' . $fname . '" -o "upload/"');
-
- $dicom = file_get_contents('upload/' . $filename . '.txt');
-
- $result = array();
- $physicalDeltaX = null;
- preg_match_all("/.*FD\s+(.*)\s+#.*PhysicalDeltaX.*/", $dicom, $result, PREG_PATTERN_ORDER);
- if(isset($result[1])){
- $physicalDeltaX = $result[1][0];
- }
-
- $result = array();
- $physicalDeltaY = null;
- preg_match_all("/.*FD\s+(.*)\s+#.*PhysicalDeltaY.*/", $dicom, $result, PREG_PATTERN_ORDER);
- if(isset($result[1]) && isset($result[1][0])){
- $physicalDeltaY = $result[1][0];
- }
-
- $result = array();
- $pixelSpacingX = null;
- $pixelSpacingY = null;
- preg_match_all("/.*DS\s+\[(.*)\\\(.*)\]\s+#.*PixelSpacing.*/", $dicom, $result, PREG_PATTERN_ORDER);
- if(isset($result[1]) && isset($result[1][0])){
- $pixelSpacingX = $result[1][0];
- }
- if(isset($result[2]) && isset($result[2][0])){
- $pixelSpacingY = $result[2][0];
- }
-
- // on retourne les Tags
- print($filename . '.png');
- print('_TAG_');
- print ($physicalDeltaX);
- print('_TAG_');
- print ($physicalDeltaY);
- print('_TAG_');
- print ($pixelSpacingX);
- print('_TAG_');
- print ($pixelSpacingY);
- print('_TAG_');
- ?>
|