Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
ver228 authored and ver228 committed Aug 16, 2017
2 parents 5f9f7a1 + ecd26d2 commit 2c75f5b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tierpsy/gui/SWTrackerViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPainter, QPen
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QApplication, QMessageBox
from tierpsy.gui.SWTrackerViewer_ui import Ui_SWTrackerViewer
from tierpsy.gui.TrackerViewerAux import TrackerViewerAuxGUI
from tierpsy.analysis.int_ske_orient.correctHeadTailIntensity import createBlocks, _fuseOverlapingGroups
Expand Down Expand Up @@ -51,11 +51,6 @@ def export(self):
line = '\t'.join([base_name] + list(map(str, frame_numbers))) + '\n'
fid.write(line)






class SWTrackerViewer_GUI(TrackerViewerAuxGUI):

def __init__(self, ui='', mask_file=''):
Expand Down Expand Up @@ -165,14 +160,25 @@ def updateSkelFile(self, skel_file, dflt_skel_size = 10):
self.trajectories_data = ske_file_id['/features_timeseries']

if self.trajectories_data['worm_index'].unique().size !=1:
raise ValueError("There is more than one worm index. This file does not seem to have been analyzed with the WT2 option.")
QMessageBox.critical(
self,
'',
"There is more than one worm index. This file does not seem to have been analyzed with the WT2 option.",
QMessageBox.Ok)

raise KeyError()

good = self.trajectories_data['timestamp'].isin(timestamp)
self.trajectories_data = self.trajectories_data[good]
self.trajectories_data.sort_values(by='timestamp', inplace=True)

if np.any(self.trajectories_data['timestamp'] < 0) or np.any(self.trajectories_data['timestamp'].isnull()):
raise ValueError('There are invalid values in the timestamp. I cannot get the stage movement information.')
QMessageBox.critical(
self,
'',
'There are invalid values in the timestamp. I cannot get the stage movement information.',
QMessageBox.Ok)
raise KeyError()

first_frame = np.where(timestamp==self.trajectories_data['timestamp'].min())[0][0]
last_frame = np.where(timestamp==self.trajectories_data['timestamp'].max())[0][0]
Expand Down

0 comments on commit 2c75f5b

Please sign in to comment.