f-hamidlab / nuclearpy

MIT License
0 stars 0 forks source link

Segmentator for CZI in vivo #24

Open Marcel-Salier opened 2 years ago

Marcel-Salier commented 2 years ago

I tried CZI from our confocal with z-stack and I got this error:

Performing segmentation on file 1 of 2


UnboundLocalError Traceback (most recent call last) Input In [17], in <cell line: 1>() ----> 1 ngs.nuclear_segmentation(method = "cellpose", diameter = 30, gamma_corr = 0.25, dc_scaleCorr = 1.9, 2 GPU = True)

File ~/Documents/GitHub/ng_tools/ngtools/segmentation.py:1305, in Segmentador.nuclear_segmentation(self, method, diameter, gamma_corr, dc_scaleCorr, GPU) 1303 for n, file in enumerate(self.data["files"]): 1304 print(f"\nPerforming segmentation on file {n+1} of {len(self.data['files'])} \n") -> 1305 self.data["files"][file]['working_array'] = wk_array(self.data["files"][file]['array'], 1306 self.data["files"][file]['metadata']['Axes']) 1308 nuclei = self.data["files"][file]['working_array'][self.data["channels_info"][self.data["dna_marker"]]].copy() 1309 if gamma_corr is not None:

File ~/Documents/GitHub/ng_tools/ngtools/segmentation.py:636, in wk_array(array, axes) 628 working_array = array 630 #elif axes == 'BVCTZYX0': 631 # working_array = array[0,0,:,0,0,:,:] 632 633 #elif axes == 'VBTCZYX0': 634 # working_array = array[0,0,0,:,13,:,:] --> 636 return working_array

UnboundLocalError: local variable 'working_array' referenced before assignment

fursham-h commented 2 years ago

Can you run this and paste the output out for me please:

for file in ngs.data["files"]:
    print(ngs.data["files"][file]['metadata']['Axes'])
Marcel-Salier commented 2 years ago

BHTCZYX0 BHTCZYX0