Getting Started with XRDImage
Installation
pip install XRDimage
Importing and Specific Functions
Importing
We can import XRDimage with just a simple import statement as shown:
import XRDimage as xrd
This step is very important as you must import our package in order to use any of the pipelines, functions, etc.
Help, Modules, and Functions
If you want to specifically run a single function rather than using our image preprocessing pipeline, then the ‘help(xrd)’ command is useful to find the function you’re looking for.
Running it will give you this list of modules, in which you could run the ‘help(xrd)’ command again to obtain more information about each module.
center_of_grav
dark_correction
ellipse_fitting
find_center
image_processing_function
image_registration
image_segmentation
mask
temperature_independent
For example, we can obtain more information about find_center by running:
help(xrd.find_center)
To use a function within the menu shown in the find_center module (In this example, the ‘find_center’ method), we can just run:
xrd.find_center.find_center(image)
#Format:
##xrd.module_name.function_name(parameters)
Make sure to pay attention to the required parameters of each function.
Using the Pipeline
As mentioned earlier, we can access a method from a module by using the ‘help()’ command to go down the hierarchy in the package.
To use the pipeline, simply use the ‘image_operations(file_path, output_folder, dark_file_path, ref_img_path)’ method with the appropriate parameters. You can find more information about the parameters on the “Pipelines” page.
xrd.image_processing_function.image_operations(file_path, output_folder, dark_file_path, ref_img_path)