4tolexx

DICOM tags modification implementation

Sep 17th, 2025
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. def modify_tags(source, overwrite: {}, remove: [])
  2.   args = ["+te"]
  3.   args.concat(overwrite.flat_map { |tag, value| ["-m", "#{tag}=#{value}"] })
  4.   args.concat(remove.flat_map { |tag| ["-e", tag] })
  5.  
  6.   system("dcmodify", *args, source)
  7. end
  8.  
Advertisement
Add Comment
Please, Sign In to add comment