-
Notifications
You must be signed in to change notification settings - Fork 3
Environment setup
Setting environment variables requires elevated privileges.
- Right-click on
My Computer
orThis PC
and selectProperties
. - Click on
Advanced system settings
. This will prompt you for your login and password. - In the
System Properties
dialog, click onEnvironment Variables...
at the bottom right. - In the bottom half of the
Environment Variables
dialog, in theSystem variables
section, click onNew...
. - In
Variable name
, type in the name of the environment variable you wish to create (i.e.DEEPSIGHT_DIR
). - In
Variable value
, copy the full path to the Deep Sight base folder (i.e.Q:\CITA\PROJECTS\BEHAVING_ARCHITECTURES\2020-DeepSight
). - Click
Ok
and close all dialogs. - If you have any console windows open, close these and re-open them.
Environment variables can be used to point to particular local directories for each user to prevent hard-coded paths in the examples and test scripts.
In Python, getting the value of an environment variable is straightforward. Deep Sight uses an environment variable called DEEPSIGHT_DIR
to locate the example datasets. This is the base directory of datasets. Subsequently, all paths to specific datasets are relative to this directory:
import os
deepsight_directory = os.getenv('DEEPSIGHT_DIR')
if deepsight_directory == None: # If there is no environment variable defined...
deepsight_directory = "C:/" # Set it to some default directory...
raise # ... or throw an exception, requiring the user to have this environment variable set
filepath = os.path.join(deepsight_directory, "relative/path/to/a/dataset.tif")
import deepsight # Import the Deep Sight library and load a grid
grid = deepsight.Grid.read(filepath)
...
All example datasets must be organized in a clear and consistent manner. Within the Deep Sight base directory, there is a 01_DataSets
directory. Within this directory, there are three directories, corresponding to each project domain - 3DPrint-Cellulose
, Fungar
, Wood
. These directories contain specific datasets for each domain.
Each dataset should be in its own folder, named after the dataset (i.e. BranchScan01
).
Each dataset folder must contain the data in the appropriate format:
- A multi-page TIFF file, named after the dataset (i.e.
BranchScan01.tif
). - An OpenVDB file, named after the dataset (i.e.
BranchScan01.vdb
). - A folder with individual TIFFs, called 'frames'. The individual TIFFs should be named after the corresponding dataset, followed by an underscore and an index, padded to 4 places. For example, if the dataset is called
BranchScan01
, then the 4th individual TIFF will be namedBranchScan01_0004.tif
. The individual TIFFs would reside in the folder%DEEPSIGHT_DIR%/01_DataSets/Wood/BranchScan01/frames
where%DEEPSIGHT_DIR%
is the aforementioned Deep Sight base directory defined by an environment variable. - An optional folder, called
meta
. This is for any collateral data, notes, photos, etc. that are tied to the dataset but do not form part of the dataset itself.