Assumption: you know your way around PowerShell or how to get there and a bit of DICOM and our RZDCX API.
If your system is x64 (probably) than make sure to regsvr32 radix.dll the x64 version.
Let's PowerShell!!!
# download rzdcx
Invoke-WebRequest -Uri http://downloads.roniza.com/rzdcx/2.0.8.7/RZDCX_2087.zip -OutFile ./rzdcx.zip
# unzip it
Expand-Archive ./rzdcx.zip -DestinationPath ./rzdcx
# regsvr32 win32 version
$rzdcx32 = Resolve-Path .\rzdcx\win32\rzdcx.dll
Start-Process regsvr32 -verb runAs -argumentlist $rzdcx32
$rzdcx64 = Resolve-Path .\rzdcx\x64\rzdcx.dll
Start-Process regsvr32 -verb runAs -argumentlist $rzdcx64
# Create DICOM Object
$DCM = New-Object -com rzdcx.DCXOBJ
# I assume you have a directory called DICOM with DICOM files in it
$files = @(Get-ChildItem ".\DICOM\*")
# Write headers
"filename, Patient Name, Patient ID"
# For each file extract and print patient name and patient id
foreach ($file in $files) {
$DCM.openFile($file)
$patname = $DCM.GetElement([int32]::Parse(00100010,'HexNumber')).Value
$patid = $DCM.GetElement([int32]::Parse(00100020,'HexNumber')).Value
Write-Host $file "," $patname "," $patid
}
Try it!
which langage is it please?
ReplyDeletelooks like powershell to me
Deletechange:
ReplyDelete$rzdcx64 = Resolve-Path .\rzdcx\win32\rzdcx.dll
to:
$rzdcx64 = Resolve-Path .\rzdcx\x64\rzdcx.dll
Hi Roni, there is a little typo in the script that leads to the following COM exception:
ReplyDelete80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
It's due to a wrong path to the x64 dll, that should be:
$rzdcx64 = Resolve-Path .\rzdcx\x64\rzdcx.dll
Hope this helps
I always get this error... any ideas on what I'm doing wrong?
ReplyDeletePS C:\> # Create DICOM Object
$DCM = New-Object -com rzdcx.DCXOBJ
New-Object : Retrieving the COM class factory for component with CLSID {D0F02240-CB2C-468B-9DF5-E0FC4CA94839} failed due to the following error: 80040154 Class not registered (Exception
from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At line:2 char:8
+ $DCM = New-Object -com rzdcx.DCXOBJ
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
New File name and location: http://downloads.roniza.com/rzdcx/2.1.0.5/RZDCX-2105.zip
ReplyDeletenewer version change download to ..... http://downloads.roniza.com/rzdcx/2.1.0.5/RZDCX-2105.zip
ReplyDelete