nettracer3d 0.6.1__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nettracer3d-0.6.1/src/nettracer3d.egg-info → nettracer3d-0.6.2}/PKG-INFO +5 -7
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/README.md +4 -6
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/pyproject.toml +1 -1
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/segmenter.py +82 -23
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/smart_dilate.py +4 -4
- {nettracer3d-0.6.1 → nettracer3d-0.6.2/src/nettracer3d.egg-info}/PKG-INFO +5 -7
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/LICENSE +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/setup.cfg +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/__init__.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/community_extractor.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/modularity.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/morphology.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/nettracer.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/nettracer_gui.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/network_analysis.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/network_draw.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/node_draw.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/proximity.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/run.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d/simple_network.py +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d.egg-info/SOURCES.txt +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d.egg-info/dependency_links.txt +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d.egg-info/entry_points.txt +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d.egg-info/requires.txt +0 -0
- {nettracer3d-0.6.1 → nettracer3d-0.6.2}/src/nettracer3d.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: nettracer3d
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Scripts for intializing and analyzing networks from segmentations of three dimensional images.
|
|
5
5
|
Author-email: Liam McLaughlin <mclaughlinliam99@gmail.com>
|
|
6
6
|
Project-URL: User_Tutorial, https://www.youtube.com/watch?v=cRatn5VTWDY
|
|
@@ -44,10 +44,8 @@ NetTracer3D is free to use/fork for academic/nonprofit use so long as citation i
|
|
|
44
44
|
|
|
45
45
|
NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
|
|
46
46
|
|
|
47
|
-
-- Version 0.6.
|
|
47
|
+
-- Version 0.6.2 updates --
|
|
48
48
|
|
|
49
|
-
1.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
4. Select all function updated to use the mini highlight overlay in larger images. Also reports the number of nodes/edges in the array in the cmd window when used.
|
|
53
|
-
5. Deleted the now unused 'hub_getter.py' script from the package.
|
|
49
|
+
1. Fixed bug with performing 2D distance transforms on CPU
|
|
50
|
+
|
|
51
|
+
2. Updated ram_lock mode in the segmenter to use smaller chunks and garbage collect better.
|
|
@@ -8,10 +8,8 @@ NetTracer3D is free to use/fork for academic/nonprofit use so long as citation i
|
|
|
8
8
|
|
|
9
9
|
NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
|
|
10
10
|
|
|
11
|
-
-- Version 0.6.
|
|
11
|
+
-- Version 0.6.2 updates --
|
|
12
12
|
|
|
13
|
-
1.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
4. Select all function updated to use the mini highlight overlay in larger images. Also reports the number of nodes/edges in the array in the cmd window when used.
|
|
17
|
-
5. Deleted the now unused 'hub_getter.py' script from the package.
|
|
13
|
+
1. Fixed bug with performing 2D distance transforms on CPU
|
|
14
|
+
|
|
15
|
+
2. Updated ram_lock mode in the segmenter to use smaller chunks and garbage collect better.
|
|
@@ -1290,41 +1290,99 @@ class InteractiveSegmenter:
|
|
|
1290
1290
|
#Change the above chunk size to None to have it auto-compute largest chunks (not sure which is faster, 64 seems reasonable in test cases)
|
|
1291
1291
|
|
|
1292
1292
|
if self.mem_lock:
|
|
1293
|
-
chunk_size =
|
|
1293
|
+
chunk_size = 32 #memory efficient chunk
|
|
1294
1294
|
|
|
1295
1295
|
|
|
1296
1296
|
def create_2d_chunks():
|
|
1297
1297
|
"""
|
|
1298
1298
|
Create chunks by z-slices for 2D processing.
|
|
1299
|
-
Each chunk is a complete z-slice with all y,x coordinates
|
|
1299
|
+
Each chunk is a complete z-slice with all y,x coordinates,
|
|
1300
|
+
unless the slice exceeds 32768 pixels, in which case it's divided into subchunks.
|
|
1300
1301
|
|
|
1301
1302
|
Returns:
|
|
1302
|
-
List of chunks, where each chunk contains the coordinates for one z-slice
|
|
1303
|
+
List of chunks, where each chunk contains the coordinates for one z-slice or subchunk
|
|
1303
1304
|
"""
|
|
1304
|
-
|
|
1305
|
-
coords_per_slice = self.image_3d.shape[1] * self.image_3d.shape[2]
|
|
1306
|
-
|
|
1307
|
-
# Create all coordinates at once
|
|
1305
|
+
MAX_CHUNK_SIZE = 32768000
|
|
1308
1306
|
chunks = []
|
|
1307
|
+
|
|
1309
1308
|
for z in range(self.image_3d.shape[0]):
|
|
1310
|
-
#
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
indexing='ij'
|
|
1315
|
-
)
|
|
1309
|
+
# Get the dimensions of this z-slice
|
|
1310
|
+
y_dim = self.image_3d.shape[1]
|
|
1311
|
+
x_dim = self.image_3d.shape[2]
|
|
1312
|
+
total_pixels = y_dim * x_dim
|
|
1316
1313
|
|
|
1317
|
-
#
|
|
1318
|
-
|
|
1319
|
-
np.
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1314
|
+
# If the slice is small enough, do not subchunk
|
|
1315
|
+
if total_pixels <= MAX_CHUNK_SIZE or not self.mem_lock:
|
|
1316
|
+
y_coords, x_coords = np.meshgrid(
|
|
1317
|
+
np.arange(y_dim),
|
|
1318
|
+
np.arange(x_dim),
|
|
1319
|
+
indexing='ij'
|
|
1320
|
+
)
|
|
1321
|
+
|
|
1322
|
+
slice_coords = np.column_stack((
|
|
1323
|
+
np.full(total_pixels, z),
|
|
1324
|
+
y_coords.ravel(),
|
|
1325
|
+
x_coords.ravel()
|
|
1326
|
+
))
|
|
1327
|
+
|
|
1328
|
+
chunks.append(list(map(tuple, slice_coords)))
|
|
1329
|
+
else:
|
|
1330
|
+
# Determine which dimension to divide (the largest one)
|
|
1331
|
+
largest_dim = 'y' if y_dim >= x_dim else 'x'
|
|
1332
|
+
|
|
1333
|
+
# Calculate how many divisions we need
|
|
1334
|
+
num_divisions = int(np.ceil(total_pixels / MAX_CHUNK_SIZE))
|
|
1335
|
+
|
|
1336
|
+
# Calculate the approx size of each division along the largest dimension
|
|
1337
|
+
if largest_dim == 'y':
|
|
1338
|
+
div_size = int(np.ceil(y_dim / num_divisions))
|
|
1339
|
+
# Create subchunks by dividing the y-dimension
|
|
1340
|
+
for i in range(0, y_dim, div_size):
|
|
1341
|
+
end_i = min(i + div_size, y_dim)
|
|
1342
|
+
y_subrange = np.arange(i, end_i)
|
|
1343
|
+
|
|
1344
|
+
# Create meshgrid for this subchunk
|
|
1345
|
+
y_sub, x_sub = np.meshgrid(
|
|
1346
|
+
y_subrange,
|
|
1347
|
+
np.arange(x_dim),
|
|
1348
|
+
indexing='ij'
|
|
1349
|
+
)
|
|
1350
|
+
|
|
1351
|
+
# Create coordinates for this subchunk
|
|
1352
|
+
subchunk_size = len(y_subrange) * x_dim
|
|
1353
|
+
subchunk_coords = np.column_stack((
|
|
1354
|
+
np.full(subchunk_size, z),
|
|
1355
|
+
y_sub.ravel(),
|
|
1356
|
+
x_sub.ravel()
|
|
1357
|
+
))
|
|
1358
|
+
|
|
1359
|
+
chunks.append(list(map(tuple, subchunk_coords)))
|
|
1360
|
+
else: # largest_dim == 'x'
|
|
1361
|
+
div_size = int(np.ceil(x_dim / num_divisions))
|
|
1362
|
+
# Create subchunks by dividing the x-dimension
|
|
1363
|
+
for i in range(0, x_dim, div_size):
|
|
1364
|
+
end_i = min(i + div_size, x_dim)
|
|
1365
|
+
x_subrange = np.arange(i, end_i)
|
|
1366
|
+
|
|
1367
|
+
# Create meshgrid for this subchunk
|
|
1368
|
+
y_sub, x_sub = np.meshgrid(
|
|
1369
|
+
np.arange(y_dim),
|
|
1370
|
+
x_subrange,
|
|
1371
|
+
indexing='ij'
|
|
1372
|
+
)
|
|
1373
|
+
|
|
1374
|
+
# Create coordinates for this subchunk
|
|
1375
|
+
subchunk_size = y_dim * len(x_subrange)
|
|
1376
|
+
subchunk_coords = np.column_stack((
|
|
1377
|
+
np.full(subchunk_size, z),
|
|
1378
|
+
y_sub.ravel(),
|
|
1379
|
+
x_sub.ravel()
|
|
1380
|
+
))
|
|
1381
|
+
|
|
1382
|
+
chunks.append(list(map(tuple, subchunk_coords)))
|
|
1383
|
+
|
|
1327
1384
|
return chunks
|
|
1385
|
+
|
|
1328
1386
|
try:
|
|
1329
1387
|
from cuml.ensemble import RandomForestClassifier as cuRandomForestClassifier
|
|
1330
1388
|
except:
|
|
@@ -1415,6 +1473,7 @@ class InteractiveSegmenter:
|
|
|
1415
1473
|
fore, back = self.process_chunk(chunk)
|
|
1416
1474
|
foreground_coords.update(fore)
|
|
1417
1475
|
background_coords.update(back)
|
|
1476
|
+
chunk[i] = None #Help garbage collection
|
|
1418
1477
|
print(f"Processed {i}/{len(chunks)} chunks")
|
|
1419
1478
|
|
|
1420
1479
|
return foreground_coords, background_coords
|
|
@@ -447,11 +447,11 @@ def compute_distance_transform(nodes):
|
|
|
447
447
|
|
|
448
448
|
if is_pseudo_3d:
|
|
449
449
|
# For 2D input, we get (2, H, W) but need (3, 1, H, W)
|
|
450
|
-
H, W =
|
|
451
|
-
indices_4d = np.zeros((3, 1, H, W), dtype=
|
|
452
|
-
indices_4d[1:, 0] =
|
|
450
|
+
H, W = nearest_label_indices[0].shape
|
|
451
|
+
indices_4d = np.zeros((3, 1, H, W), dtype=nearest_label_indices.dtype)
|
|
452
|
+
indices_4d[1:, 0] = nearest_label_indices # Copy Y and X coordinates
|
|
453
453
|
# indices_4d[0] stays 0 for all Z coordinates
|
|
454
|
-
|
|
454
|
+
nearest_label_indices = indices_4d
|
|
455
455
|
|
|
456
456
|
return nearest_label_indices
|
|
457
457
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: nettracer3d
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Scripts for intializing and analyzing networks from segmentations of three dimensional images.
|
|
5
5
|
Author-email: Liam McLaughlin <mclaughlinliam99@gmail.com>
|
|
6
6
|
Project-URL: User_Tutorial, https://www.youtube.com/watch?v=cRatn5VTWDY
|
|
@@ -44,10 +44,8 @@ NetTracer3D is free to use/fork for academic/nonprofit use so long as citation i
|
|
|
44
44
|
|
|
45
45
|
NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
|
|
46
46
|
|
|
47
|
-
-- Version 0.6.
|
|
47
|
+
-- Version 0.6.2 updates --
|
|
48
48
|
|
|
49
|
-
1.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
4. Select all function updated to use the mini highlight overlay in larger images. Also reports the number of nodes/edges in the array in the cmd window when used.
|
|
53
|
-
5. Deleted the now unused 'hub_getter.py' script from the package.
|
|
49
|
+
1. Fixed bug with performing 2D distance transforms on CPU
|
|
50
|
+
|
|
51
|
+
2. Updated ram_lock mode in the segmenter to use smaller chunks and garbage collect better.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|