diff --git a/SingleCellDataExtraction.py b/SingleCellDataExtraction.py index 0eceeac..faf29b9 100644 --- a/SingleCellDataExtraction.py +++ b/SingleCellDataExtraction.py @@ -236,8 +236,12 @@ def ExtractSingleCells(masks,image,channel_names,output, mask_props=None, intens scdata_z = MaskZstack(masks_loaded,image,channel_names_loaded_checked, mask_props=mask_props, intensity_props=intensity_props) #Write the singe cell data to a csv file using the image name + # Determine the image name by cutting off its extension im_full_name = os.path.basename(image) - im_name = im_full_name.split('.')[0] + im_tokens = im_full_name.split(os.extsep) + if len(im_tokens) < 2: im_name = im_tokens[0] + elif im_tokens[-2] == "ome": im_name = os.extsep.join(im_tokens[0:-2]) + else: im_name = os.extsep.join(im_tokens[0:-1]) # iterate through each mask and export csv with mask name as suffix for k,v in scdata_z.items():