Skip to content

Commit

Permalink
handle negative eigenvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Dec 4, 2023
1 parent 888a996 commit 7d3d748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/napatrackmater/Trackmate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pathlib import Path
import concurrent
from .clustering import Clustering
from lightning import Trainer


class TrackMate:
def __init__(
Expand Down Expand Up @@ -59,7 +59,7 @@ def __init__(
self.center = center
self.compute_with_autoencoder = compute_with_autoencoder
self.latent_features = latent_features
self.pretrainer = Trainer(accelerator=self.accelerator, devices=self.devices)

if image is not None:
self.image = image.astype(np.uint8)
else:
Expand Down
8 changes: 2 additions & 6 deletions src/napatrackmater/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from lightning import Trainer
from typing import List
from tqdm import tqdm
from .Trackmate import TrackMate

class PointCloudDataset(Dataset):
def __init__(self, clouds: List[PyntCloud], center=True, scale_z=1.0, scale_xy=1.0):
Expand All @@ -42,7 +41,7 @@ def __getitem__(self, idx):
return point_cloud


class Clustering(TrackMate):
class Clustering:
def __init__(
self,
accelerator: str,
Expand All @@ -60,10 +59,6 @@ def __init__(
center=True,
compute_with_autoencoder=True,
):
super().__init__(xml_path=None, spot_csv_path=None, track_csv_path=None,
AttributeBoxname = None, TrackAttributeBoxname = None,
TrackidBox = None, seg_image=label_image,
autoencoder_model=model, accelerator=accelerator, devices=devices, axes=axes, key=key,)

self.accelerator = accelerator
self.devices = devices
Expand Down Expand Up @@ -179,6 +174,7 @@ def _latent_computer(self, i, dim):
def _create_cluster_labels(self):

ndim = len(self.label_image.shape)
self.pretrainer = Trainer(accelerator=self.accelerator, devices=self.devices)
if ndim == 2:

labels, centroids, clouds, marching_cube_points = _label_cluster(
Expand Down

0 comments on commit 7d3d748

Please sign in to comment.