MINC_MODIFY_HEADER(1)

πŸ’– minc_modify_header β€” the MINC User's Guide glow-up edition πŸ’–

okay bestie, buckle up, because this is the little tool that lets you poke at the header of a minc file. yes, just the header. the vibes. the metadata. the ✨attributes✨. and it's from the MINC User's Guide, so you know it's legit.


✨ NAME ✨

minc_modify_header β€” modify the attributes in the header of a minc file πŸŽ€


🌸 SYNOPSIS 🌸

minc_modify_header [<options>] <file>.mnc

πŸ’… DESCRIPTION πŸ’…

So like, minc_modify_header lets you modify, insert or delete attributes in a minc file. and here's the tea: if possible, the file is modified in place, without copying the data. no cap. πŸ”₯

That in-place magic happens when you're inserting (modifying) an attribute that already exists and that ends up being the same length or shorter in the new file. slay, efficient.

But if an attribute is deleted or lengthened? 😭 then a complete copy of the data is made, resulting in a completely new file that replaces the original. it's giving "new phone who dis" but for files.

If the file is compressed, then it is first decompressed into a file whose name is either the same as that of the original file up to the ".mnc" extension, or the same minus the compression extension (".bz", ".bz2", ".gz", ".Z", ".z" or ".zip"). and bestie, listen: the new file will not be re-compressed. she's staying decompressed, periodt. πŸ’€

Care is taken to completely overwrite any existing attribute when inserting a new attribute, so that information is guaranteed to be removed from the file. we do not leave ghost data. we are thorough. πŸ‘‘


🌈 OPTIONS 🌈

heads up gorgeous: options can be specified in abbreviated form (as long as they are unique) and can be given anywhere on the command line. yes, anywhere. she's flexible. πŸ’…
  • -sinsert var:attr=value β€” insert a string attribute into the header. if the attribute doesn't exist, or the new string is longer than the existing one, then all data in the file will be copied. (copy time, bestie 🫢)
  • -sappend var:attr=value β€” basically -sinsert's sister, but she appends the string to the attribute's value. if the attribute already exists, it must be of string type. no exceptions. πŸ’…
  • -dinsert var:attr=value(,...) β€” insert a double precision attribute into the header. if the attribute doesn't exist, or the new attribute is longer than the existing one, then all data in the file will be copied. you can also pass a comma-separated array of values. go off. πŸ”₯
  • -dappend var:attr=value(,...) β€” like -dinsert but she appends the list of double precision values to the attribute's value. if the attribute already exists, it must be of double precision type. respect the type, babes.
  • -delete var:attr β€” delete an attribute from the header. 🚨 USE OF THIS OPTION WILL FORCE A COMPLETE COPY OF ALL DATA TO BE MADE. like, the whole thing. every byte. 🚨 use -sinsert with an empty string instead to delete the information without copying data (the attribute will continue to exist, it's just... empty. ghost attribute energy πŸ‘»).
  • -help β€” print a summary of the command-line options and exit. your little cheat sheet. πŸŽ€
  • -version β€” print the program's version number and exit. iykyk. ✨

πŸ¦‹ EXAMPLES: πŸ¦‹

1. to replace the patient name with an identifier string:

minc_modify_header file.mnc -sinsert 'patient:full_name=C02-F0023'

2. to delete the patient name completely (forcing a copy of all data):

minc_modify_header file.mnc -delete 'patient:full_name'

3. to hide the patient name without copying data, assuming that we know that the attribute exists (the attribute will remain in the file, but it will be empty):

minc_modify_header file.mnc -sinsert 'patient:full_name='

look at that last one. empty string. stealth mode. πŸ™ˆ iconic behavior honestly.


πŸ‘‘ AUTHOR πŸ‘‘

Peter Neelin β€” the main character who wrote this. respect. 🫢


πŸ’œ COPYRIGHTS πŸ’œ

Copyright Β© 1995 by Peter Neelin


okay that's the whole page bestie, you're fully caught up. πŸ’–βœ¨

and for the cute sign-off: this little legend comes from the MINC User's Guide, rocking the date stamp $Date: 2004-05-25 21:33:11 $ β€” so yes, she's an elder icon, a vintage queen, and she still slays. πŸŽ€πŸ’…πŸ‘‘

πŸ“¦ where this page comes from