-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added conda recipe to create data package * add build script for linux Co-authored-by: Edoardo Pasca <[email protected]>
- Loading branch information
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd %RECIPE_DIR%\.. | ||
%PYTHON% setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd $RECIPE_DIR/.. | ||
$PYTHON setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package: | ||
name: cil-data | ||
version: 21.0.0 | ||
|
||
build: | ||
number: 0 | ||
|
||
requirements: | ||
|
||
build: | ||
- python | ||
|
||
about: | ||
home: http://www.ccpi.ac.uk/cil | ||
license: Apache 2.0 License | ||
summary: 'CCPi Core Imaging Library' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- coding: utf-8 -*- | ||
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL). | ||
|
||
# Copyright 2017 UKRI-STFC | ||
# Copyright 2017 University of Manchester | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from distutils.core import setup | ||
import os | ||
import sys | ||
|
||
|
||
cil_version='21.0.0' | ||
|
||
setup( | ||
name="cil-data", | ||
version=cil_version, | ||
data_files = [('share/cil', [ '24737_fd_normalised.nxs', | ||
'boat.tiff', | ||
'camera.png', | ||
'peppers.tiff', | ||
'rainbow.png', | ||
'resolution_chart.tiff', | ||
'shapes.png' | ||
])], | ||
|
||
# metadata for upload to PyPI | ||
author="CCPi developers", | ||
maintainer="Edoardo Pasca", | ||
maintainer_email="[email protected]", | ||
description='CCPi Core Imaging Library - Example Data', | ||
license="Apache v2.0", | ||
keywords="Dataset", | ||
url="http://www.ccpi.ac.uk/cil", # project home page, if any | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os, sys | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from PIL import Image | ||
|
||
data_dir = os.path.abspath( | ||
os.path.join(sys.prefix, 'share','cil') | ||
) | ||
|
||
pics = ['boat.tiff', 'camera.png', 'rainbow.png', 'resolution_chart.tiff', 'shapes.png'] | ||
for which in pics: | ||
dpath = os.path.join(data_dir, which) | ||
with Image.open(dpath) as f: | ||
print("opening {}".format(dpath)) | ||
bands = f.getbands() | ||
if len(bands) > 1: | ||
if len(bands) == 4: | ||
f = f.convert('RGB') | ||
bands = f.getbands() | ||
plt.imshow(f) | ||
plt.show() | ||
|