Skip to content

Commit e5ee3ac

Browse files
committed
Rename package
1 parent 0522e67 commit e5ee3ac

17 files changed

+21
-21
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ They should be placed inside the folder `lib` in the project's root as follows.
2525
│ └───avaspec3
2626
│ │ └───avaspecx64.dll
2727
├───scripts
28-
├───singlepixel
28+
├───spas
2929
├───requirements.txt
3030
├───setup.py
3131
├───stats
@@ -40,7 +40,7 @@ They should be placed inside the folder `lib` in the project's root as follows.
4040
In python:
4141

4242
``` python
43-
import singlepixel as sp
43+
import spas as sp
4444
sp.walsh_patterns(save_data=True)
4545
```
4646
By default the patterns are 1024x768 PNG images saved in `./Walsh_64_64/`
@@ -81,7 +81,7 @@ conda install pywin32
8181

8282
* Initilization (just once, two consecutively returns an error)
8383
``` python
84-
from singlepixel import *
84+
from spas import *
8585
spectrometer, DMD, DMD_initial_memory = init()
8686
```
8787

@@ -140,7 +140,7 @@ disconnect(spectrometer, DMD)
140140
Reconstruct the measurements contained in the variable `meas`
141141
``` python
142142
import spyrit.misc.walsh_hadamard as wh
143-
from singlepixel import reconstruction_hadamard
143+
from spas import reconstruction_hadamard
144144
H = wh.walsh2_matrix(64)
145145
rec = reconstruction_hadamard(acquisition_parameters.patterns, 'walsh', H,
146146
meas)
@@ -149,14 +149,14 @@ rec = reconstruction_hadamard(acquisition_parameters.patterns, 'walsh', H,
149149
Bin the reconstructed hypercube in 8 bins between 530 and 730 nm
150150

151151
``` python
152-
from singlepixel import spectral_binning
152+
from spas import spectral_binning
153153
rec_bin, wavelengths_bin, _ = spectral_binning(
154154
rec.T, acquisition_parameters.wavelengths, 530, 730, 8)
155155
```
156156

157157
Plot the 8 bins
158158
``` python
159-
from singlepixel import plot_color
159+
from spas import plot_color
160160
plot_color(rec_bin, wavelengths_bin)
161161
```
162162

@@ -173,7 +173,7 @@ meas = file['spectral_data']
173173

174174
Read the metadata (we need the get the acquisition order of the patterns)
175175
``` python
176-
from singlepixel import read_metadata, reconstruction_hadamard
176+
from spas import read_metadata, reconstruction_hadamard
177177
_, acquisition_parameters, _, _ = read_metadata('../meas/my_first_measurement' + '_metadata.json')
178178

179179
```
@@ -201,7 +201,7 @@ meas = file['spectral_data']
201201

202202
Read the metadata (we need the get the acquisition order of the patterns)
203203
``` python
204-
from singlepixel import read_metadata, reconstruction_hadamard
204+
from spas import read_metadata, reconstruction_hadamard
205205
_, acquisition_parameters, _, _ = read_metadata('../meas/my_first_measurement' + '_metadata.json')
206206

207207
```
@@ -211,7 +211,7 @@ _, acquisition_parameters, _, _ = read_metadata('../meas/my_first_measurement' +
211211
An example network can be downloaded [here](https://www.creatis.insa-lyon.fr/~ducros/spyritexamples/2021_ISTE/NET_c0mp_N0_50.0_sig_0.0_Denoi_N_64_M_1024_epo_40_lr_0.001_sss_20_sdr_0.2_bs_256_reg_1e-07.pth) , which you can save in `./models/`. It allows to reconstruction images from only 1'024 hadamard coefficients (i.e., 2'048 raw measurements)
212212

213213
``` python
214-
from singlepixel import ReconstructionParameters, setup_reconstruction
214+
from spas import ReconstructionParameters, setup_reconstruction
215215
network_params = ReconstructionParameters(
216216
img_size=64,
217217
CR=1024,
@@ -237,18 +237,18 @@ model, device = setup_reconstruction(cov_path, mean_path, '../stats/H.npy', mode
237237

238238
Load noise calibration parameters (provided with the data or computed using `/noise-calibration/noise_modeling.py`)
239239
``` python
240-
from singlepixel import load_noise
240+
from spas import load_noise
241241
noise = load_noise('../noise-calibration/fit_model.npz')
242242
```
243243

244244
Bin before reconstruction and plot
245245

246246
``` python
247-
from singlepixel import spectral_binning
247+
from spas import spectral_binning
248248
meas_bin, wavelengths_bin, _, noise_bin = spectral_binning(meas.T, acquisition_parameters.wavelengths, 530, 730, 8, noise)
249249
```
250250
``` python
251-
from singlepixel import reconstruct, plot_color
251+
from spas import reconstruct, plot_color
252252
rec = reconstruct(model, device, meas_bin[0:8192//4,:], 1, noise_bin)
253253
plot_color(rec, wavelengths_bin)
254254

noise-calibration/noise-analysis.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"import numpy as np\n",
1919
"from matplotlib import pyplot as plt\n",
2020
"\n",
21-
"from singlepixel import read_metadata"
21+
"from spas import read_metadata"
2222
]
2323
},
2424
{

noise-calibration/noise_modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import numpy as np
1111
from matplotlib import pyplot as plt
1212

13-
from singlepixel import *
13+
from spas import *
1414

1515
#%% Init
1616
spectrometer, DMD, DMD_initial_memory = init()

scripts/acquisition-recon-multiprocessing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
in "real-time", using multiprocessing.
55
"""
66

7-
from singlepixel import *
7+
from spas import *
88

99
if __name__ == '__main__':
1010

scripts/acquisition-recon-sequential.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
performed after the acquisition and not in "real-time".
66
"""
77

8-
from singlepixel import *
8+
from spas import *
99

1010
import numpy as np
1111
import spyrit.misc.walsh_hadamard as wh

scripts/acquisiton_script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from singlepixel import *
1+
from spas import *
22

33
#%% Init
44
spectrometer, DMD, DMD_initial_memory = init() # just once, two consecutively returns an error

scripts/raster_scan.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from matplotlib import pyplot as plt
66
from scipy.io import loadmat
77

8-
from singlepixel import *
8+
from spas import *
99

1010
def reconstruction_hadamard(acquisition_metadata, Q, M, N=64):
1111
ind_opt = acquisition_metadata.patterns[1::2]

scripts/reconstruction_script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from matplotlib import pyplot as plt
77
from spyrit.learning.model_Had_DCAN import Hadamard_Transform_Matrix
88

9-
from singlepixel import read_metadata, reconstruction_hadamard
9+
from spas import read_metadata, reconstruction_hadamard
1010

1111
# Matlab patterns
1212
#file = loadmat('../data/matlab.mat')

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
setup(
4-
name='singlepixel',
4+
name='spas',
55
version='0.0.1',
66
author='Guilherme Beneti Martins',
77
packages=find_packages())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

singlepixel/noise.py spas/noise.py

File renamed without changes.
File renamed without changes.

singlepixel/reconstruction_nn.py spas/reconstruction_nn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from spyrit.learning.model_Had_DCAN import compNet, noiCompNet, DenoiCompNet
2222
from spyrit.learning.nets import load_net
2323

24-
from singlepixel.noise import noiseClass
24+
from spas.noise import noiseClass
2525

2626
class netType(IntEnum):
2727
"""Possible model architectures.
File renamed without changes.

0 commit comments

Comments
 (0)