Skip to content

Commit

Permalink
Project name change from ray to gala
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSavage committed Dec 13, 2012
1 parent 9183fed commit 6909036
Show file tree
Hide file tree
Showing 105 changed files with 65 additions and 65 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
project (ray)
project (gala)

include (ExternalProject)

Expand Down Expand Up @@ -63,8 +63,8 @@ else ()
include (scikit-learn)
include (syngeo)

# Install ray
add_custom_target (ray ALL
# Install gala
add_custom_target (gala ALL
DEPENDS ${APP_DEPENDENCIES}
COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ray: segmentation of nD images
# gala: segmentation of nD images

Ray is a python library for performing and evaluating image segmentation,
distributed under the open-source
[MIT license](http://www.opensource.org/licenses/mit-license.php).
It supports n-dimensional images (images, volumes, videos, videos of
Gala is a python library for performing and evaluating image segmentation,
distributed under the open-source [Janelia Farm license](http://janelia-flyem.github.com/janelia_farm_license.html).

Gala supports n-dimensional images (images, volumes, videos, videos of
volumes...) and multiple channels per image.

## Requirements (tested versions)
Expand All @@ -30,10 +30,10 @@ but if you don't install it you can still use SVM or AdaBoost classifiers.

## Installation

### Installing ray
### Installing gala

Ray is a python library and can be installed in two ways:
* Add the ray directory to your PYTHONPATH environment variable
Gala is a python library and can be installed in two ways:
* Add the gala directory to your PYTHONPATH environment variable
* Use setup.py to install it into your preferred python:

% python setup.py install
Expand All @@ -46,7 +46,7 @@ download, compile, test, and install requirements into a specified buildem
prefix directory.

```
% cmake -D BUILDEM_DIR=/path/to/platform-specific/build/dir <ray directory>
% cmake -D BUILDEM_DIR=/path/to/platform-specific/build/dir <gala directory>
% make
```

Expand All @@ -56,19 +56,19 @@ using the buildem system.
### Testing

The test coverage is rather tiny, but it is still a nice way to check you
haven't completely screwed up your installation. From the Ray root directory,
run `python test/test_ray.py` to run some regression tests.
haven't completely screwed up your installation. From the Gala root directory,
run `python test/test_gala.py` to run some regression tests.

## Usage

### Agglomeration

Suppose you have already trained a pixel level boundary detector, and want to
perform mean agglomeration on it. This is the simplest form of agglomeration
and was the initial design spec for Ray. Now:
and was the initial design spec for Gala. Now:

```python
from ray import imio, agglo, morpho
from gala import imio, agglo, morpho
# prob is a numpy ndarray
# probabilities-* can be one file for 2D segmentation, or many files for 3D.
prob = imio.read_image_stack('probabilities-*.png')
Expand Down Expand Up @@ -111,7 +111,7 @@ These are provided by the `classify` module, and built into the `agglo.Rag`
class.

```python
from ray import classify
from gala import classify
gs = imio.read_h5_stack('gold-standard-segmentation.h5')
fm = classify.MomentsFeatureManager()
fh = classify.HistogramFeatureManager()
Expand Down Expand Up @@ -221,7 +221,7 @@ we have done?
We can use the `evaluate` submodule to check our performance.

```python
from ray import evaluate
from gala import evaluate
from scipy.ndimage.measurements import label
t = imio.read_h5_stack('test-gold-standard.h5')
s = label(ucm_test < 0.5)[0]
Expand All @@ -242,6 +242,6 @@ fm = evaluate.fm_index(s, t)
pr = evaluate.pixel_wise_precision_recall(s, t)
```

That's a quick summary of the capabilities of Ray. There are of course many
That's a quick summary of the capabilities of Gala. There are of course many
options under the hood, many of which are undocumented... Feel free to push me
to update the documentation of your favorite function!
2 changes: 1 addition & 1 deletion bin/comparestacks
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from numpy import *
from ray import imio, morpho, evaluate as ev
from gala import imio, morpho, evaluate as ev
from scipy.ndimage import binary_dilation, generate_binary_structure
import getopt
import errno
Expand Down
2 changes: 1 addition & 1 deletion bin/ray-evaluate → bin/gala-evaluate
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ except ImportError:
from scipy.ndimage import label

# local modules
from ray import imio, agglo, morpho, evaluate as ev
from gala import imio, agglo, morpho, evaluate as ev

if __name__ == '__main__':

Expand Down
2 changes: 1 addition & 1 deletion bin/ray-pixel → bin/gala-pixel
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ this_dir = os.path.dirname(sys.argv[0])
pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from ray import pixel
from gala import pixel
sys.exit(pixel.entrypoint(sys.argv))
4 changes: 2 additions & 2 deletions bin/ray-remove-inclusions → bin/gala-remove-inclusions
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ this_dir = os.path.dirname(sys.argv[0])
pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from ray import imio, agglo
from gala import imio, agglo
import argparse
import logging

Expand All @@ -24,7 +24,7 @@ def main(argv):
dest='output_name', default='./raveler-export')
args = parser.parse_args()

MasterLogger = logging.getLogger('ray-reresegment')
MasterLogger = logging.getLogger('gala-reresegment')
MasterLogger.propagate = False
MasterLogger.setLevel(logging.DEBUG)
console = logging.StreamHandler(sys.stdout)
Expand Down
8 changes: 4 additions & 4 deletions bin/ray-segment → bin/gala-segment
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ except ImportError:
'Synapse-aware mode not available.')

# local modules
from ray import imio, agglo, morpho, classify, features
from gala import imio, agglo, morpho, classify, features

try:
from ray import stack_np
from gala import stack_np
except ImportError:
pass

Expand Down Expand Up @@ -125,7 +125,7 @@ if __name__ == '__main__':

if args.use_neuroproof:
try:
from ray import stack_np
from gala import stack_np
except ImportError:
MasterLogger.warning("NeuroProof could not be imported")
sys.exit(1)
Expand All @@ -149,7 +149,7 @@ if __name__ == '__main__':
MasterLogger.error("Experiment name cannot be a path")
sys.exit(1)

prim = logging.FileHandler(experiment_prefix + ".ray-segment.log", 'a')
prim = logging.FileHandler(experiment_prefix + ".gala-segment.log", 'a')
prim.setLevel(logging.DEBUG)
prim.setFormatter(logging.Formatter(
fmt='%(asctime)s %(levelname)-8s %(message)s',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ this_dir = os.path.dirname(sys.argv[0])
pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from ray import segmentation_pipeline
from gala import segmentation_pipeline
sys.exit(segmentation_pipeline.entrypoint(sys.argv))
2 changes: 1 addition & 1 deletion bin/ray-test-package → bin/gala-test-package
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ this_dir = os.path.dirname(sys.argv[0])
pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from ray import test_package
from gala import test_package
sys.exit(test_package.entrypoint(sys.argv))
6 changes: 3 additions & 3 deletions bin/ray-train → bin/gala-train
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ except ImportError:
logging.warning('Could not import syngeo. Synapse-aware mode not available.')

# local modules
from ray import imio, agglo, morpho, classify, features, evaluate
from gala import imio, agglo, morpho, classify, features, evaluate


if __name__ == '__main__':
Expand Down Expand Up @@ -135,7 +135,7 @@ if __name__ == '__main__':

if args.use_neuroproof:
try:
from ray import stack_np
from gala import stack_np
except ImportError:
MasterLogger.warning("NeuroProof could not be imported. sys path: %s" % sys.path)
raise
Expand All @@ -153,7 +153,7 @@ if __name__ == '__main__':
MasterLogger.error("Experiment name cannot be a path")
sys.exit(1)

prim = logging.FileHandler(experiment_prefix + ".ray-train.log", 'a')
prim = logging.FileHandler(experiment_prefix + ".gala-train.log", 'a')
prim.setLevel(logging.DEBUG)
prim.setFormatter(logging.Formatter(
fmt='%(asctime)s %(levelname)-8s %(message)s',
Expand Down
2 changes: 1 addition & 1 deletion bin/ray-valprob → bin/gala-valprob
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ this_dir = os.path.dirname(sys.argv[0])
pkg_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.insert(0, pkg_dir)

from ray import valprob
from gala import valprob
sys.exit(valprob.entrypoint(sys.argv))
6 changes: 3 additions & 3 deletions ray/__init__.py → gala/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Ray
Gala
===
Ray is a Python package for nD image segmentation.
Gala is a Python package for nD image segmentation.
"""

import sys, logging
if sys.version_info[:2] < (2,6):
logging.warning('Ray has not been tested on Python versions prior to 2.6'+
logging.warning('Gala has not been tested on Python versions prior to 2.6'+
' (%d.%d detected).'%sys.version_info[:2])

__author__ = 'Juan Nunez-Iglesias <[email protected]>, '+\
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ray/classify.py → gala/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_classifier(name='random forest', *args, **kwargs):
return DefaultRandomForest(*args, **kwargs)
else:
raise NotImplementedError('Classifier "%s" is either not installed ' +
'or not implemented in Ray.')
'or not implemented in Gala.')

class DefaultRandomForest(RandomForestClassifier):
def __init__(self, *args, **kwargs):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
session_manager, pixel, features

try:
from ray import stack_np
from gala import stack_np
except ImportError:
np_installed = False
else:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ray/stitch.py → gala/stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy import zeros, bool, hstack, vstack, newaxis, array, savetxt
from scipy.ndimage.filters import median_filter, gaussian_filter
from scipy.ndimage.measurements import label
from ray import single_arg_read_image_stack
from gala import single_arg_read_image_stack

class EvalAction(argparse.Action):
def __call__(parser, namespace, values, option_string=None):
Expand Down
34 changes: 17 additions & 17 deletions ray/test_package.py → gala/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def testIlastik(self):

class testModules(unittest.TestCase):
def gen_watershed(self):
from ray import imio
from gala import imio
import numpy
from skimage import morphology as skmorph
from scipy.ndimage import label

self.datadir = os.path.abspath(os.path.dirname(sys.modules["ray"].__file__)) + "/testdata/"
self.datadir = os.path.abspath(os.path.dirname(sys.modules["gala"].__file__)) + "/testdata/"

prediction = imio.read_image_stack(self.datadir +"pixelprobs.h5",
group='/volume/prediction', single_channel=False)
Expand All @@ -70,9 +70,9 @@ def gen_watershed(self):
def testNPRFBuild(self):
if not np_installed:
self.assertTrue(np_installed)
from ray import stack_np
from ray import classify
self.datadir = os.path.abspath(os.path.dirname(sys.modules["ray"].__file__)) + "/testdata/"
from gala import stack_np
from gala import classify
self.datadir = os.path.abspath(os.path.dirname(sys.modules["gala"].__file__)) + "/testdata/"

cl = classify.load_classifier(self.datadir + "agglomclassifier_np.rf.h5")
fm_info = json.loads(str(cl.feature_description))
Expand All @@ -87,10 +87,10 @@ def testNPRFBuild(self):
self.assertEqual(stack.number_of_nodes(), 78)

def testAggloRFBuild(self):
from ray import agglo
from ray import features
from ray import classify
self.datadir = os.path.abspath(os.path.dirname(sys.modules["ray"].__file__)) + "/testdata/"
from gala import agglo
from gala import features
from gala import classify
self.datadir = os.path.abspath(os.path.dirname(sys.modules["gala"].__file__)) + "/testdata/"

cl = classify.load_classifier(self.datadir + "agglomclassifier.rf.h5")
fm_info = json.loads(str(cl.feature_description))
Expand All @@ -108,7 +108,7 @@ def testAggloRFBuild(self):
def testNPBuild(self):
if not np_installed:
self.assertTrue(np_installed)
from ray import stack_np
from gala import stack_np
watershed, boundary, dummy = self.gen_watershed()
stack = stack_np.Stack(watershed, boundary)
self.assertEqual(stack.number_of_nodes(), 3629)
Expand All @@ -118,7 +118,7 @@ def testNPBuild(self):
self.assertEqual(stack.number_of_nodes(), 82)

def testAggoBuild(self):
from ray import agglo
from gala import agglo
watershed, boundary, dummy = self.gen_watershed()
stack = agglo.Rag(watershed, boundary, nozeros=True)
self.assertEqual(stack.number_of_nodes(), 3630)
Expand All @@ -133,10 +133,10 @@ def testWatershed(self):

class testFlows(unittest.TestCase):
def testNPFlow(self):
import ray
import gala
if not np_installed:
self.assertTrue(np_installed)
self.datadir = os.path.abspath(os.path.dirname(sys.modules["ray"].__file__)) + "/testdata"
self.datadir = os.path.abspath(os.path.dirname(sys.modules["gala"].__file__)) + "/testdata"
writedir = "/tmp/NPregtest"

if os.path.exists(writedir):
Expand All @@ -154,7 +154,7 @@ def testNPFlow(self):
writefile.write(configstr)
writefile.close()

os.system("ray-segmentation-pipeline " + writedir + " --config-file " +
os.system("gala-segmentation-pipeline " + writedir + " --config-file " +
"/tmp/NPregtest/config.json --regression --enable-use-neuroproof >& /dev/null")

log_data = open(self.datadir + "/seg-pipeline-np.log", 'r').read()
Expand All @@ -167,8 +167,8 @@ def testNPFlow(self):
open("/tmp/NPregtest/.seg-pipeline.log", 'r').read())

def testRegFlow(self):
import ray
self.datadir = os.path.abspath(os.path.dirname(sys.modules["ray"].__file__)) + "/testdata"
import gala
self.datadir = os.path.abspath(os.path.dirname(sys.modules["gala"].__file__)) + "/testdata"
writedir = "/tmp/regtest"

if os.path.exists(writedir):
Expand All @@ -185,7 +185,7 @@ def testRegFlow(self):
writefile.write(configstr)
writefile.close()

os.system("ray-segmentation-pipeline " + writedir + " --config-file " +
os.system("gala-segmentation-pipeline " + writedir + " --config-file " +
"/tmp/regtest/config.json --regression --disable-use-neuroproof >& /dev/null")

log_data = open(self.datadir + "/seg-pipeline.log", 'r').read()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@



setup(name = "ray",
setup(name = "gala",
version = "1.0",
url = "https://github.com/jni/ray",
description = "Ray is a python library for performing and evaluating image segmentation.",
long_description = "Ray is a python library for performing and evaluating of image segmentation. It supports n-dimensional images (images, volumes, videos, videos of volumes...) and multiple channels per image.",
url = "https://github.com/jni/gala",
description = "Gala is a python library for performing and evaluating image segmentation.",
long_description = "Gala is a python library for performing and evaluating of image segmentation. It supports n-dimensional images (images, volumes, videos, videos of volumes...) and multiple channels per image.",
author = "Juan Nunez-Iglesias",
author_email = '[email protected]',
license = 'LICENSE.txt',
packages = ['ray', 'ray.features'],
package_data = {'ray': ['testdata/*.*', 'testdata/original_grayscales/*'] },
packages = ['gala', 'gala.features'],
package_data = {'gala': ['testdata/*.*', 'testdata/original_grayscales/*'] },
install_requires = [ ],
scripts = ["bin/ray-segmentation-pipeline", "bin/ray-train", "bin/ray-test-package", "bin/ray-pixel", "bin/comparestacks", "bin/ray-valprob"]
scripts = ["bin/gala-segmentation-pipeline", "bin/gala-train", "bin/gala-test-package", "bin/gala-pixel", "bin/comparestacks", "bin/gala-valprob"]
)
Loading

0 comments on commit 6909036

Please sign in to comment.