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

29 autonorm config generator #2

Merged
merged 43 commits into from
Oct 29, 2020
Merged

Conversation

KedoKudo
Copy link
Contributor

The following features have been implemented in this PR

  • a new module, preprocess is added to provide the function generate_config_CG1D that can take a single directory or a list of directory to generate the configuration file.
  • a new module, npmath is added to provide auxiliary function for other main modules.
  • a new CLI, generate_config.py is added to provide CLI for the function generate_config_CG1D.
  • corresponding documentation is updated to include instructions on how to use the newly added feature.

closes #1

@KedoKudo KedoKudo added the enhancement New feature or request label Oct 28, 2020
@KedoKudo KedoKudo requested a review from JeanBilheux October 28, 2020 17:02
@KedoKudo KedoKudo self-assigned this Oct 28, 2020
@JeanBilheux
Copy link
Contributor

I installed the package and ran the unit tests and they all passed. But I had the following error when trying to use it

$python scripts/generate_config.py ~/IPTS/IPTS-25967/raw/radiographs/Aug25_2020/ ~/Desktop/
Parsing input
Traceback (most recent call last):
  File "scripts/generate_config.py", line 31, in <module>
    generate_config_CG1D(rootdir, output=output, tolerance_aperature=tor)
  File "/Users/j35/git/NeutronImagingScripts/neutronimaging/preprocess.py", line 133, in generate_config_CG1D
    raise NotImplementedError
NotImplementedError

@JeanBilheux
Copy link
Contributor

It works when using the notebook you created.

Question regarding the format of the json. What is the '0' in the list of df, ob? Is it an increment number for each file? I think a simple list of df, or ob files should be good enough, something like list_df: [{'file_1','time':4545}, {'file_2': ....} }
Screen_Shot_2020-10-29_at_7_34_58_AM

@JeanBilheux
Copy link
Contributor

I love the display JSON feature you showed me but unfortunately, it does not seem to work on chrome for me (mac). :-(. I had to use pprint instead (not as cool but does the job)

@KedoKudo
Copy link
Contributor Author

I installed the package and ran the unit tests and they all passed. But I had the following error when trying to use it

$python scripts/generate_config.py ~/IPTS/IPTS-25967/raw/radiographs/Aug25_2020/ ~/Desktop/
Parsing input
Traceback (most recent call last):
  File "scripts/generate_config.py", line 31, in <module>
    generate_config_CG1D(rootdir, output=output, tolerance_aperature=tor)
  File "/Users/j35/git/NeutronImagingScripts/neutronimaging/preprocess.py", line 133, in generate_config_CG1D
    raise NotImplementedError
NotImplementedError

When using the script (CLI), you need to specify the output file name, such as output.json as the second argument.
If you want to process a list of directories, the current interface requires you to use comma to separate them, as shown in the readme:

generate_config.py IPTS-20267,IPTS-20268 IPTS-20267-20268.json

@bidochon
Copy link

My mistake, I thought the output was a folder, not a file name. It works!

@KedoKudo
Copy link
Contributor Author

@JeanBilheux
The following changes have been made to address the review feedback

  • Explicit input arguments for raw images, open-beam images and dark-field images.
    • Both the module and the CLI have been updated with new interface
    • The example notebook has been updated using new interface
    • The instruction in Readme.md has been updated
  • In the final output JSON file, the following fields no longer have a indexing number as key
    • list_sample
    • list_ob
    • list_df

Please let me know if there is any additional changes needed 😄

@JeanBilheux
Copy link
Contributor

the new version got tested and it works great.

comments: first try failed because the config file name provided did not have the .json extension.

Ideal would be to let the user know that the extension is missing.

@JeanBilheux JeanBilheux merged commit 8e43139 into main Oct 29, 2020
@KedoKudo KedoKudo deleted the 29_autonorm_config_generator branch October 29, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-normalization config file generator for imaging
3 participants