oldBodyParts = self.dataFrame.columns.get_level_values(1)
_, idx = np.unique(oldBodyParts, return_index=True)
oldbodyparts2plot = list(oldBodyParts[np.sort(idx)])
self.new_bodyparts = list(set(self.bodyparts) - set(oldbodyparts2plot))
// Checking if user added a new label
if self.new_bodyparts==[]: // i.e. no new label
After Change
oldBodyParts = self.dataFrame.columns.get_level_values(1)
_, idx = np.unique(oldBodyParts, return_index=True)
oldbodyparts2plot = list(oldBodyParts[np.sort(idx)])
self.new_bodyparts = [x for x in self.bodyparts if x not in oldbodyparts2plot ]
// Checking if user added a new label
if self.new_bodyparts==[]: // i.e. no new label
self.figure,self.axes,self.canvas,self.toolbar = self.image_panel.drawplot(self.img,img_name,self.iter,self.index,self.bodyparts,self.colormap)
self.choiceBox,self.rdb,self.slider,self.checkBox = self.choice_panel.addRadioButtons(self.bodyparts,self.file,self.markerSize)