Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track files: Support multi-line key-values #1926

Merged
merged 3 commits into from
Jan 31, 2020
Merged

Conversation

Lestropie
Copy link
Member

Issue arose due to potential for multi-line "command_history" field following #1603.

Closes #1925.

Issue arose due to potential for multi-line "command-history" field following #1603.
Closes #1925.
@Lestropie
Copy link
Member Author

I'll need to also modify tckinfo to display such information properly.

@Lestropie
Copy link
Member Author

$ tckedit 0.tck test1.tck -force
$ tckedit test1.tck test2.tck -force
$ tckedit test2.tck test3.tck -force
$ tckinfo test3.tck
***********************************
  Tracks file: "test3.tck"
    act:                  anat/5tt.mif
    backtrack:            1
    command_history:      tckedit 0.tck test1.tck -force  (version=3.0_RC4-421-g67ce65b4-dirty)
                          tckedit test1.tck test2.tck -force  (version=3.0_RC4-421-g67ce65b4-dirty)
                          tckedit test2.tck test3.tck -force  (version=3.0_RC4-421-g67ce65b4-dirty)
    count:                0
    crop_at_gmwmi:        1
    downsample_factor:    3
    fod_power:            0.25
    init_threshold:       0.1
    lmax:                 8
    max_angle:            45
    max_num_attempts:     1000000000
    max_num_tracks:       10000000
    max_seed_attempts:    50
    max_trials:           1000
    method:               iFOD2
    mrtrix_version:       3.0_RC4-421-g67ce65b4-dirty
    output_step_size:     1.25
    rk4:                  0
    samples_per_step:     4
    seed_dynamic:         diffusion/CSD8.mif
    sh_precomputed:       1
    source:               diffusion/CSD8.mif
    step_size:            1.25
    stop_on_all_include:  0
    threshold:            0.1
    timestamp:            1580346089.9433526993
    total_count:          0
    unidirectional:       0
    ROI:                  exclude ../diffusion/mask.mif

Does not yet have the ability to hide contents of properties with an egregiously large amount of lines as mrinfo does, but it's probably not high priority, it'll be far less likely to occur with such data.

@Lestropie
Copy link
Member Author

P.S. @matteofrigo: This doesn't necessarily guarantee that these data will work with nibabel out of the box, since their code probably makes a similar assumption about key-values within track files being single-line. So if it still doesn't work after this fix it would be worth reporting to them. There is a chance that it'll "work", e.g. it will import only the final line of command_history; or it might fail because it detects a duplicated key as erroneous. Depends on the particulars of their code.

@matteofrigo
Copy link
Contributor

matteofrigo commented Jan 30, 2020

@Lestropie It solved the problem and nibabel behaves as you predicted, i.e. it reads only the final line of command_history.

Thanks!
m

@Lestropie Lestropie merged commit d68a504 into dev Jan 31, 2020
@Lestropie
Copy link
Member Author

Excellent; thanks for the test!

@Lestropie Lestropie deleted the tck_file_command_history_fix branch January 31, 2020 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants