TFF_MANIPULATE_DATATYPE.PY(1)

πŸ“¦
version 0.3 Β· 3 versions
, in debian trixie, ubuntu questing

πŸ’– NAME πŸ’–

okay bestie, welcome to the TFF_MANIPULATE_DATATYPE.PY(1) manual page, and buckle up because this one is genuinely useful 🫢

tff_manipulate_datatype.py β€” manipulate a TRX file array to change its data type. that's the whole job. it goes in, it pokes the internal arrays, it changes what type of number they're stored as. iconic behaviour honestly πŸ‘‘


✨ DESCRIPTION ✨

here's the vibe check on how you actually call it:

tff_manipulate_datatype.py [-h]
       [--positions_dtype {float16,float32,float64}]
              [--offsets_dtype {uint32,uint64}] [--dpv NAME DTYPE] [--dps NAME
              DTYPE] [--groups NAME DTYPE] [--dpg GROUP NAME DTYPE] [-f]
              in_tractogram out_tractogram

so like, the whole point: this tool manipulates a TRX file's internal array to change their data type. no cap, that's the description. πŸ’…

now the important deets, bestie β€” each instance of --dps, --dpv, --groups needs 2 arguments (FILE, DTYPE). and --dpg is the extra one, it needs 3 arguments (GROUP, FILE, DTYPE). the way that --dpg just needs more than everyone else? main character energy, periodt. ✨

the choices of DTYPE are:

  • (u)int8, (u)int16, (u)int32, (u)int64
  • float16, float32, float64
  • bool

and here's the example command, straight up, so you can see it in the wild:

tff_manipulate_datatype.py input.trx output.trx --position float16 --offsets uint64     --dpv color_x uint8 --dpv color_y uint8 --dpv color_z uint8     --dpv fa float16 --dps algo uint8 --dps clusters_QB uint16     --dps commit_colors uint8 --dps commit_weights float16     --group CC uint64 --dpg CC mean_fa float64

okay that's a lot of flags in one breath but you ate that, you got this πŸ“


🌸 positional arguments: 🌸

  • in_tractogram β€” the input TRX file. your little guy going in. πŸ¦‹
  • out_tractogram β€” the output filename. and bestie, heads up: the format must be one of trk, tck, vtk, fib, dpy, trx. those are the only fits it's accepting, sorry πŸ’€

πŸ’… options: πŸ’…

  • -h, --help β€” show this help message and exit. the classic. the icon. the one true escape hatch 😌
  • -f β€” force overwriting of the output files. it's giving "no thoughts, just replace" πŸ”₯

πŸŽ€ Data type options: πŸŽ€

  • --positions_dtype {float16,float32,float64} β€” specify the datatype for positions for trx. the choices are float16, float32, float64. pick your fighter πŸ’–
  • --offsets_dtype {uint32,uint64} β€” specify the datatype for offsets for trx. the choices are uint32, uint64. only two options, keep it simple ✨

🌈 Streamlines metadata options: 🌈

  • --dpv NAME DTYPE β€” specify the datatype for a specific data_per_vertex. two arguments, don't forget the second one πŸ™ˆ
  • --dps NAME DTYPE β€” specify the datatype for a specific data_per_streamline. also two arguments, also very slay 🌸
  • --groups NAME DTYPE β€” specify the datatype for a specific group. yep, two arguments here too πŸ’œ
  • --dpg GROUP NAME DTYPE β€” specify the datatype for a specific data_per_group. this one's the overachiever with three arguments β€” GROUP, NAME, DTYPE. it said why have two when you can have three πŸ‘‘

lowkey just remember: --dps, --dpv, --groups β†’ 2 args. --dpg β†’ 3 args. that's the whole plot twist and it's not even a plot twist, it's just the rules 🧚

okay bestie that's literally the entire page, you're so smart for reading it, go change some datatypes and be free 🌟

tff_manipulate_datatype.py 0.3 β€” July 2024 πŸ’– byeee, mwah 🫢

πŸ“¦ where this page comes from