2024 Workshop on Methods for 3D Microstructure Studies¶
- August 14, 15, 16
- Carnegie Mellon University, Pittsburgh Pa, USA.
This post will be updated with relevant information about the python programming portion of the workshop.
Main Web site¶
Agenda¶
DREAM3D-NX Download Information¶
There are two different ways to get DREAM3D-NX Standalone and Anaconda/Miniconda
Standalone¶
If you are not interested in python integration then go to https://www.dream3d.io/PrecompiledBinaries/ and download the version appropriate for your operating system. The file is a compressed "portable" version of DREAM3D-NX. You place the decompressed folder where you want. There is NO installer to run. The Data is included in this version.
Anaconda/Miniconda Version¶
If you ARE interested in the python integration or plan on attending the python tutorial break out session, then this is what you want.
- Install Anaconda or Miniconda
- Go to https://www.dream3d.io/python_docs/ and follow the directions there.
- Download the data from https://www.dream3d.io/binaries/DREAM3DNXData.zip and place that data somewhere on your hard drive.
- WARNING: For ease of use during the initial DREAM3D-NX presentations you may want to use the StandAlone package instead as the prebuilt pipelines that will be used during those presentations use file system paths that are relative to the executable.
Synthetic Microstructure Generation¶
Currently DREAM3D-NX does not have any synthetic building capabilities built into it yet so for these sessions we will be using the legacy version of DREAM.3D version 6.5.171.
Please use one of these links to download this version of legacy DREAM.3D
- https://dream3d.bluequartz.net/binaries/DREAM3D-6.5.171-OSX-x86_64.dmg
- https://dream3d.bluequartz.net/binaries/DREAM3D-6.5.171-OSX-arm64.dmg
- https://dream3d.bluequartz.net/binaries/DREAM3D-6.5.171-Win64.zip
- https://dream3d.bluequartz.net/binaries/DREAM3D-6.5.171-Linux-x86_64.tar.gz
Python Tutorial Information¶
If you are interested in the python portion of the DREAM3D workshop please be sure to install DREAM3D-NX using the commands located at https://www.dream3d.io/python_docs/
You can use https://docs.anaconda.com/miniconda/miniconda-install/ if you do not want to install Anaconda.
- Pip packages are NOT available for DREAM3D-NX.
- Python 3.12 is recommended for the most compatibility with other python packages
- ATTENTION: MacOS Intel Users: There is only a python 3.11 version available due to compatibility issues.
- Version 24.08.10 for
dream3dnx
We will be attempting to cover the following topics but may change up if attendees want a different topic.
- Integrating DREAM3D-NX filters with numpy and other python packages
- Systematically modifying an existing pipeline.
- Creating your own custom DREAM3D-NX filter
Required Data¶
You will need to manually download the standard DREAM3D-NX data files from https://www.dream3d.io/binaries/DREAM3DNXData.zip. You may place this generally anywhere on your system but closer to the "top" of your file system or in your home directory is an ideal location. For those on MacOS, placing the folder into your home directory is a great place.
Helpful Python Codes¶
At some point these bits of python code will be needed
# ---------------------------------------------
def check_filter_result(filter: nx.IFilter, result: nx.IFilter.ExecuteResult) -> None:
if len(result.warnings) != 0:
print(f'{filter.name()} :: Warnings: {result.warnings}')
has_errors = len(result.errors) != 0
if has_errors:
print(f'{filter.name()} :: Errors: {result.errors}')
raise RuntimeError(result)
print(f"{filter.name()} :: No errors running the filter")
# ---------------------------------------------
def check_pipeline_result(result: nx.Result) -> None:
"""
This function will check the `result` for any errors. If errors do exist then a
`RuntimeError` will be thrown. Your own code to modify this to return something
else that doesn't just stop your script in its tracks.
"""
if len(result.warnings) != 0:
for w in result.warnings:
print(f'Warning: ({w.code}) {w.message}')
has_errors = len(result.errors) != 0
if has_errors:
#print(f'Pipeline :: Errors: {result.errors}')
for err in result.errors:
print(f'Error: ({err.code}) {err.message}')
raise RuntimeError(result)
print("Pipeline :: No errors running the pipeline")