1
1
# NeutronImagingScripts
2
2
3
- This pakcage contains a suite of Python modules and scripts that are critical for the data reduction of Neutron Imaging at Oak Ridge National Laboratory.
3
+ This pakcage contains a suite of Python modules and scripts that are critical for the data reduction of Neutron Imaging
4
+ at Oak Ridge National Laboratory.
4
5
5
6
6
7
## Overview
@@ -17,7 +18,8 @@ $ pip install NeutronImagingScripts
17
18
18
19
### Developers
19
20
For developers, it is __ highly__ recommended to setup an isolated virtual environment for this repository.
20
- After cloning this repository to your local machine, go to the root of this repo and use the follwing commands to install dependencies
21
+ After cloning this repository to your local machine, go to the root of this repo and use the follwing commands to
22
+ install dependencies
21
23
22
24
``` bash
23
25
$ pip install -r requirements.txt
@@ -38,41 +40,39 @@ Examples of using this package as a Python module are provided as Jupyter Notebo
38
40
39
41
#### _ Generate Configuration File for Data Reduction_
40
42
To generate the ` json ` file that is needed for subsequent data reduction, use
43
+
41
44
``` bash
42
- $ generate_config.py \
43
- IPTS-20267/raw/radiographs \
44
- IPTS-20267/raw/ob \
45
- IPTS-20267/raw/df \
46
- IPTS-20267.json
45
+ $ generate_config.py IPTS-20267/raw/radiographs IPTS-20267/raw/ob IPTS-20267/raw/df IPTS-20267.json
47
46
```
47
+
48
48
where
49
+
49
50
- ` IPTS-20267/raw/radiographs ` contains the raw images
50
51
- ` IPTS-20267/raw/ob ` contains open beam images (white field)
51
52
- ` IPTS-20267/raw/df ` contains dark field images
52
53
53
54
If you would like to have __ multiple__ experiment configuration files __ nested__ in one ` json ` file, simply use
55
+
54
56
``` bash
55
- $ generate_config.py \
56
- IPTS-20267/raw/radiographs,IPTS-20267-2/raw/radiographs \
57
- IPTS-20267/raw/ob \
58
- IPTS-20267/raw/df \
59
- IPTS-20267.json
57
+ $ generate_config.py IPTS-20267/raw/radiographs,IPTS-20267-2/raw/radiographs IPTS-20267/raw/ob IPTS-20267/raw/df IPTS-20267.json
60
58
```
59
+
61
60
notice that:
62
61
- You can have more than one folder for raw images, but they need to be within the same string separated by ` , ` .
63
62
- You can have only __ one__ folder for open beam directory
64
63
- You cna have only __ one__ folder for dark field directory
65
64
66
65
The command above will yield a ` json ` file with the following structure
66
+
67
67
``` json
68
- {
69
- "IPTS-20267" : {" CONFIG_DATA" },
70
- "IPTS-20268" : {" CONFIG_DATA" }
71
- }
68
+ {"IPTS-20267" : {" CONFIG_DATA" },
69
+ "IPTS-20268" : {" CONFIG_DATA" }
70
+ }
72
71
```
73
72
74
73
The default tolerance for the categorization with respect to aperture positions is 1mm.
75
74
However, you can change the default value by specify it as below
75
+
76
76
``` bash
77
77
$ generate_config.py \
78
78
IPTS-20267/raw/radiographs \
@@ -84,18 +84,23 @@ $ generate_config.py \
84
84
#### _ MCP Detector correction_
85
85
After installing this package, the scripts located in ` scripts ` should be visible in your Path.
86
86
Simpy type ` mcp_detector_correction.py ` , you should see the following
87
+
87
88
``` bash
88
89
$ mcp_detector_correction.py
89
90
Usage:
90
91
mcp_detector_correction [--skipimg] [--verbose] < input_dir> < output_dir>
91
92
mcp_detector_correction (-h | --help)
92
93
mcp_detector_correction --version
93
94
```
95
+
94
96
Therefore, you can process the example data with the following command at the root of this repo
97
+
95
98
``` bash
96
99
$ mcp_detector_correction.py data tmp
97
100
```
101
+
98
102
and you will see the following in your terminal
103
+
99
104
``` bash
100
105
$ mcp_detector_correction.py data tmp
101
106
Parsing input
@@ -108,6 +113,7 @@ corrected image summary
108
113
type: float64
109
114
Writing data to tmp
110
115
```
116
+
111
117
> NOTE: make sure you create a ` tmp ` folder first.
112
118
113
119
## Developer Notes
0 commit comments