zdavatz / gdt2dicom

Convert a gdt file and an image folder to a dicom file
GNU General Public License v3.0
0 stars 1 forks source link

Canon `Aplio A` Pflichtfelder #46

Closed zdavatz closed 8 months ago

zdavatz commented 8 months ago
  1. Canon Aplio A Pflichtfelder
  2. Pflichtfelder_Canon
    (0008,0050) AccessionNumber
    (0010,0010) PatientName
    (0010,0020) PatientiD
    (0020,000D) StudyinstanceUID
    (0032,1060) RequestedProcedureDescription
    (0040,0100) ScheduledProcedureStepSequence
    ITEM 1|
    (0008,0060) Modality
    (0040,0001) ScheduledStationAETitle
    (0040,0002) ScheduledProcedureStepStartDate
    (0040,0003) ScheduledProcedureStepStartTime
    (0040,0007) ScheduledProcedureStepDescription
    (0040,0009) ScheduledProcedureStepID
    ITEM 2
    (0040,1001) RequestedProcedurelD

    Dicom Conformance Statement Aplio a.pdf

zdavatz commented 8 months ago

the following are additional to Mortara H-Scribe, X-Scribe, R-Scribe


(0040,0001) ScheduledStationAETitle
(0040,0007) ScheduledProcedureStepDescription
(0040,0009) ScheduledProcedureStepID
(0040,1001) RequestedProcedurelD
zdavatz commented 8 months ago

Query Worklist for AplioA: https://github.com/zdavatz/gdt2dicom/assets/4953/c089a158-f7c5-48cb-ba64-7766dc9dfad5

$directory = 'E:\gdt'
$originalFileName = 'epat.gdt'

# Check if the file exists in the directory
$files = Get-ChildItem -Path $directory -Filter $originalFileName

if ($files.Count -gt 0) {
    $timestamp = Get-Date -Format 'yyyyMMddHHmmss'
    $counter = 1

    foreach ($file in $files) {
        $extension = $file.Extension
        $newName = "$timestamp" + "_epat_$counter" + $extension
        $newPath = Join-Path -Path $directory -ChildPath $newName
        Rename-Item -Path $file.FullName -NewName $newPath
        $counter++
    }

    Write-Host "Files renamed successfully."
} else {
    Write-Host "No files named '$originalFileName' found in the directory."
}

$gdtDirectory = 'E:\gdt'
$outputDirectory = 'C:\Users\Arzt\Documents\gdt2dicom\dicom\sono'
$gdt2dicomExe = 'C:\Users\Arzt\Documents\gdt2dicom\gdt2dicom.exe'

# Create the output directory if it doesn't exist
if (-not (Test-Path -Path $outputDirectory)) {
    New-Item -ItemType Directory -Path $outputDirectory | Out-Null
}

# Get all GDT files in the input directory
$gdtFiles = Get-ChildItem -Path $gdtDirectory -Filter '*.gdt'

foreach ($gdtFile in $gdtFiles) {
    $outputFile = Join-Path -Path $outputDirectory -ChildPath ($gdtFile.Name -replace '\.gdt$', '.wl')
    & $gdt2dicomExe --gdt-file $gdtFile.FullName --output $outputFile
}

Get-ChildItem -Path $outputDirectory -Filter "*.wl" | ForEach-Object {
    & "dcmodify" -i "(0040,0100)[0].(0008,0060)=US" "$($_.FullName)"
        & "dcmodify" -i "0040,0001=APLIOA" "$($_.FullName)"
        & "dcmodify" -i "0032,1060=petersen" "$($_.FullName)"
}

# Get all .gdt files in the specified directory
$files = Get-ChildItem -Path $directory -Filter *.gdt

# Remove each file
foreach ($file in $files) {
    Remove-Item $file.FullName -Force
}

Write-Host "All .gdt files in $directory have been removed."

# Get all .bak files in the specified directory
$files = Get-ChildItem -Path $outputDirectory -Filter *.bak

# Remove each file
foreach ($file in $files) {
    Remove-Item $file.FullName -Force
}

Write-Host "All .bak files in $outputDirectory have been removed."
zdavatz commented 8 months ago

Kurzanleitung_Patienten-Daten auf USB-Stick.pdf

zdavatz commented 2 months ago

AplioA_4 AplioA_3 AplioA_2 AplioA_1

zdavatz commented 2 months ago

haltiner_6 haltiner_5 haltiner_4 haltiner_3 haltiner_2 haltiner_1