-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many member functions have been changed to property attributes. There…
… is a new Zval model where one Scan has many Zvals. A particular scan model now has a slice_coords attribute which is an array (via the Zval model) of all the slice coordinates of the image volume. This will make the library more consistent so that coordinates are not given as indexes in-slice, while z-values are given between-slice.
- Loading branch information
1 parent
eb44105
commit f12c0e3
Showing
10 changed files
with
1,171 additions
and
53 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
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,19 @@ | ||
import numpy as np | ||
import pylidc as pl | ||
|
||
|
||
scans = pl.query(pl.Scan) | ||
nscans = scans.count() | ||
for i,scan in enumerate(scans): | ||
print i+1,"/",nscans | ||
|
||
images = scan.load_all_dicom_images(verbose=0) | ||
img_zs = [float(img.ImagePositionPatient[-1]) for img in images] | ||
img_zs = np.unique(img_zs) | ||
|
||
for zval in img_zs: | ||
z = pl.Zval() | ||
z.val = float(zval) | ||
z.scan = scan | ||
|
||
pl._session.commit() |
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,7 @@ | ||
CREATE TABLE zvals ( | ||
id INTEGER NOT NULL, | ||
scan_id INTEGER, | ||
val FLOAT, | ||
PRIMARY KEY (id), | ||
FOREIGN KEY(scan_id) REFERENCES scans (id) | ||
); |
Oops, something went wrong.