# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.8.8 64-bit (''base'': conda)'
#     name: python3
# ---

import matplotlib.pyplot as plt
from tkinter import Tk, filedialog, Label


def dialog_askdirectory():
    root = Tk()
    Label(root, text="Select data folder")
    folder_path = filedialog.askdirectory()
    root.destroy()
    return folder_path


def dialog_askfilename():
    root = Tk()
    Label(root, text="Select data folder")
    path = filedialog.askopenfilename() 
    root.destroy()
    return  path


# import sys
# sys.path.append('..')x
import nanoscopy as nano

path = dialog_askdirectory() 
images = nano.spm.io.read(path)
len(images)

images[1].headers

im=images[0]['Z'][0]
print(images[0].traces)
plt.imshow(im)
plt.show()

data = images[0].get_data('Z')
data

StarcoderdataJupyterScriptsDedupFiltered