Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple images at once #51

Open
yechp opened this issue Jun 14, 2018 · 4 comments
Open

Multiple images at once #51

yechp opened this issue Jun 14, 2018 · 4 comments

Comments

@yechp
Copy link

yechp commented Jun 14, 2018

Hi.
I'm working on a research process. I need to process a large amount of images. Like, a lot. Is there any form within Nefi2 to feed multiple inputs at once?

yechp

@tastyminerals
Copy link
Collaborator

Have you tried python3 nefi2.py --help?

usage: nefi2.py [-h] [-p PIPELINE] [-d DIR] [-f FILE] [-o OUT]

optional arguments:
  -h, --help            show this help message and exit
  -p PIPELINE, --pipeline PIPELINE
                        Specify a saved pipeline xml file.
  -d DIR, --dir DIR     Specify a directory with images for batch processing.
  -f FILE, --file FILE  Specify an image file to process.
  -o OUT, --out OUT     Specify output directory.

PIPELINE is a json file that contains a list of algorithms and settings for processing:

cat nefi2/default_pipelines/a_junius.json 
  [
    ["Watershed DE Adaptive",{"Foreground Iteration":0, "Background Iteration":0,"Threshold Block Size":11,"Threshold Constant":1, "type":"Segmentation", "store_image":false}],
    ["Median Blur",{"channel1":true,"channel2":true,"channel3":true,"kernelsize":2, "type":"Preprocessing", "store_image":false}],
    ["Guo Hall Thinning",{"store_image":false,"type":"Thinning"}],
    ["Guo Hall Graph Detection",{"store_image":false,"type":"Graph Detection"}],
    ["Keep only LCC",{"store_image":false,"type":"Graph Filtering"}],
    ["Simple Cycle",{"store_image":false,"type":"Graph Filtering"}]
  ]

you can find a set of default pipelines under nefi2/default_pipelines dir.

@yechp
Copy link
Author

yechp commented Jun 14, 2018

Ok... I'm sorry but I just started with python. I come from R and NetLogo. Probably this question is going a very ignorant one but... where do I run this code?

@tastyminerals
Copy link
Collaborator

You need a Linux, where you can open console, navigate to nefi directory and run nefi2.py.
For example:

git clone https://github.com/05dirnbe/nefi.git
cd nefi/
python3 nefi2.py -p nefi2/default_pipelines/a_junius.json -d dir_with_images -o processed_images

I cannot test if current nefi2 version is working on Windows unfortunately.

@yechp
Copy link
Author

yechp commented Jun 14, 2018

Ok! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants