-
Notifications
You must be signed in to change notification settings - Fork 35
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
WIP: Add YAML files, converted from parameter txt files #14
Conversation
Note: elastix does not yet support YAML for parameter files!
Note: elastix does not yet support YAML for parameter files!
For the record: YAML representations of floating point numbers (including |
Thanks @stefanklein 👍
Good question... My little converter elastix_txt2yml.cxx does support parameters with mixed value types:
And as far as I can see, the YAML specification does allow such mixed lists as well. (I tried https://www.yamllint.com and it says: "Valid YAML!") So the short answer is: yes, it does! 😃 |
NewSamplesEveryIteration: [true, true, true, true] | ||
NumberOfSpatialSamples: [5000, 5000, 5000, 5000] | ||
NewSamplesEveryIteration: [true, true] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- With respect to issue Par0004.bs_base.NRU08, Parameters.Par0008.elastic parameters specified more than once #13, note that YAML does allow parameters to be specified more than once. (As you see here, specifying
NewSamplesEveryIteration
twice.) Of course, it should still be detected by elastix, which would then produce an error message.
Great!
From: Niels Dekker ***@***.***>
Sent: Thursday, January 23, 2025 5:53 PM
To: SuperElastix/ElastixModelZoo ***@***.***>
Cc: Stefan Klein ***@***.***>; Mention ***@***.***>
Subject: Re: [SuperElastix/ElastixModelZoo] WIP: Add YAML files, converted from parameter txt files (PR #14)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Very nice! It looks pretty good to me.
Thanks @stefanklein<https://github.com/stefanklein> 👍
Does it also support parameters with mixed value types?
Good question... My little converter elastix_txt2yml.cxx<https://gist.github.com/N-Dekker/6679b024939f49827686bce10235b26f> does support parameters with mixed value types:
- (FullSearchSpace0 "t_z" 5 -10.0 30.0 0.1)
+ FullSearchSpace0: ["t_z", 5, -10.0, 30.0, 0.1]
And as far as I can see, the YAML specification does allow such mixed lists as well. (I tried https://www.yamllint.com<https://www.yamllint.com/> and it says: "Valid YAML!") So the short answer is: yes, it does! 😃
—
Reply to this email directly, view it on GitHub<#14 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAF2LNKIYGQ5LGG7QK4K46D2MEM63AVCNFSM6AAAAABVXBHPYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJQGQYDSMJQHE>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
beautiful! |
|
@lassoan @mstaring @stefanklein The aim of this PR is to show what a YAML parameter file for
elastix
might look like. Does it look good to you?Please have a look at the second commit, Convert all *.yml files to valid YAML. It shows the diff between the old txt format and the proposed new YAML format.
Specifically:
Double slashes are replaced by hashtags, to denote comment (following the YAML specification):
When a parameter has multiple values, they are enclosed by square brackets, and comma-separated:
YAML also supports to have a new line for each value, but that seems a bit too verbose.
When a parameter has just a single value, it is not enclosed by square brackets! (This is just a choice, of course. We could also choose to always use square brackets for parameter values.)
Double-quotes are removed from
"true"
and"false"
(following the YAML specification):Other double-quotes are preserved. YAML supports double-quoted string values. A double-quoted string like
"unsigned short"
represents one single value.For this PR, I just wrote a little program to convert those txt files to yml: elastix_txt2yml.cxx
Note: This is still work in progress, so it should not yet be merged!
elastix
does not yet support YAML.