BIC-MNI / minc-toolkit-v2

Version 2 of the minc-toolkit, uses tools based on ITK version 4.x
GNU General Public License v3.0
48 stars 21 forks source link

minc_modify_header can't modify variable values #163

Open moreje opened 1 year ago

moreje commented 1 year ago

Hi, if I can modify the values of an attribute for a given variable, I did not found how to define new values for the variable itself for example, in a 4D PET volume: the variable time cannot be modified, whereas lenght, step,etc... attributes can be modified is it a bug?

vfonov commented 1 year ago

it's because time and step are not attributes in the minc world, they are considered to be variables. So, it's possible to modify them using mincedit or with library (i.e inside python script).

moreje commented 6 months ago

ok, do you see any possibility to include this into a bash script ? I can execute: mincedit xxxx.mnc nano but I can't find how to modify the header in my script from that :(

gdevenyi commented 6 months ago

If you examine the contents of mincedit, you will see it dumps the mincheader, opens it in an editor, then re-generates a a new empty file with mincgen, followed by minccopy to re-populate the data. Should you need to do such an automated modification, you could code up the same thing, with a sed/awk to programmatically edit the header file.