fapatap
fapatap

Reputation: 57

Imagemagick using metadata properties to mass rename images

I have got a ton of dicom files that I want to mass rename using their properties tags.

My question is, what is the syntax for taking a property tag(such as dcm:SeriesNumber) for every image and using it to rename the images in the directory?

I'm guessing it involves breaking it down to the relevant tag using -identify -verbose and then somehow passing that string over to the filename property?

Really would appreciate the help(using win10 command line).

Upvotes: 0

Views: 607

Answers (1)

fapatap
fapatap

Reputation: 57

Figured it out.

convert *.dcm -set filename:f "%[dcm:SeriesNumber]"_"%[dcm:AcquisitionNumber]" "%[filename:f].jpg"

the "" after filename:f hold the string that's going to represent the file name

[] brackets hold the metadata property, that you can chain by using % percentage sign which declares a new property

Upvotes: 1

Related Questions