LUA is fast: this command takes about 1s : dgate "--lua:a=1; for i=0,1000000 do a=Command.DataSetType end; print(a)"
So lua is fast enough to do elementary image processing (e.g., masking image regions to anonymise). Implement GIMP/GLUAS like calls to read and write pixels in the dicom image.
Add Data.Compression menber to read and change compression. Required to allow editing pixels in compressed images.
Timing an operation:
result:
MONOCHROME2
2.61e-005
Merging a complex study:
Code
[lua]ImportConverter0 = if Data.Modality=='MR' and string.find(Data.SeriesDescription, 'T/3D/FFE/')~=nil then script('merge study modality MR seriesdesc T/3D/FFE/* after 60') end;MergeSeriesConverter0 = script('newuids except 0020,000d'); Data.ImageNumber = 1000*Data.AcquisitionNumber + Data.ImageNumber; Data.SeriesDescription = 'T/3D/FFE/Merged SENSE'
image processing:
This sample code took 0.42 s for a 512 x 512 image
More image processing:
Loop took 51 ms for 512x512 image
Marcel