Faical Yannick P. Congo
faical.congo@nist.gov
MRaDS
Tuesday, January 16, 2018
NIST
https://slides.com/faicalyannickcongo/deck-4/live
I have to
run my study again and
again on...
Humm...
What I need is
sort of
def threshold(filename):
result = dict(filename=filename,
threshold_image=threshold_image(filename),
**extract_metadata(filename))
return result
def min_size(data):
data['min_size'] =
f_min_size(data['scale_microns'],
data['scale_pixels'])
return data
def clean(data):
data['clean_image'] =
~remove_small_holes(~data['threshold_image'],
data['min_size'])
return data
def reveal(data):
data['pearlite_image'] =
reveal_pearlite(data['clean_image'])
return data
def cemmentite(data):
data['cemmentite_fraction'] =
frac1(data['clean_image'])
return data
def ferrite(data):
data['ferrite_fraction'] =
frac0(data['clean_image'])
return data
def pearlite(data):
data['pearlite_fraction'] =
frac1(data['pearlite_image'])
return data
def save(data):
clean_name = data['filename'].
split("/")[-1].
split(".")[0]
file_path = "{0}.json".format(clean_name)
filtered_data = {}
filtered_data['filename'] = clean_name
filtered_data['pearlite_fraction'] = data['pearlite_fraction']
filtered_data['ferrite_fraction'] = data['ferrite_fraction']
filtered_data['cemmentite_fraction'] = data['cemmentite_fraction']
with open(file_path, "w") as save_file:
save_file.write(json.dumps(filtered_data, sort_keys=True,
indent=4, separators=(',', ': ')))
## Setup Version Control
$ git init
$ git add --all
$ git commit -m "Setting up the repo."
## Setup Sumatra without CoRR
$ smt init SEM-Images-Smt .
## Setup Sumatra with CoRR
$ smt init -s=config.json SEM-Images-Smt .
## Run Study without Sumatra
$ python study.py
## Run Study with Sumatra
$ smt run --executable=python --main=study.py
## Produces:
## - A folder: .git
## Produces:
## - A folder: .smt
## - A file: .smt/project
## - A file: .smt/records
## Produces:
## - A list of json files.
## Produces:
## - A row in .smt/records
## - A list of json files.
## Trace the study run
$ reprozip trace SEM-Image-Rpz python study.py
## Trace with CoRR
$ reprozip trace -s=config_file SEM-Image-Rpz python study.py
## Produces:
## - A folder: .reprozip
## - A file: bundle.rpz
## Run the study
$ maestro -s -d 1 -y -c -t 2 sem-study.yaml
## Archive the run with CoRR
$ archive -f config.json record_path/sem-study.yaml -d 1
## Produces:
## - A folder: sample_output
## - A folder: */sem-images-maestrowf
## - A folder: */*/*_recordID
Faical Yannick P. Congo
faical.congo@nist.gov
Wednesday, September 27, 2017
Institute for Bioscience and Biotechnology Research
Faical Yannick P. Congo
faical.congo@nist.gov
Wednesday, September 27, 2017
Institute for Bioscience and Biotechnology Research
http://10.5.100.207:5000/
https://github.com/usnistgov/MRaDS-2017-Demo-Study