diff --git a/BIDSHandler/CreationTool/Application.py b/BIDSHandler/CreationTool/Application.py index 92a7306e3f0660f62ee734392de63261cabe03be..ea69241cd09734285ac3275e72a548ae452a22e7 100644 --- a/BIDSHandler/CreationTool/Application.py +++ b/BIDSHandler/CreationTool/Application.py @@ -319,10 +319,11 @@ class Application(tk.Frame): Tools.clean_frame(self.main_frame) self.architecture_frame = tk.Frame(self.main_frame) - self.architecture_frame.pack() + self.architecture_frame.place(relx=0.5, rely=0.5, anchor='center') self.architecture_label = tk.Label(self.architecture_frame, text='Architecture of the project') self.architecture_label.grid(row=0, column=0) + self.architecture_label.config(font=('Arial', 20)) self.session_label = tk.Label(self.architecture_frame, text='Number of sessions:') self.session_label.grid(row=1, column=0) @@ -333,6 +334,8 @@ class Application(tk.Frame): command=self.architecture_finish) self.architecture_confirm_button.grid(row=2, column=0, columnspan=2) + self.architecture_confirm_button.config(height=3, width=20, relief='solid') + def architecture_finish(self): """ This method is used to finish the creation of the architecture of the new BIDS project. @@ -372,6 +375,9 @@ class Application(tk.Frame): self.architecture_confirm_button = tk.Button(self.architecture_frame, text='Continue', command=self.next_step) self.architecture_confirm_button.pack() + self.architecture_show_project.config(height=3, width=20, relief='solid') + self.architecture_confirm_button.config(height=3, width=20, relief='solid') + def actual_project_state(self): """ This method is used to show the current state of the project. @@ -400,7 +406,11 @@ class Application(tk.Frame): Tools.clean_frame(self.main_frame) self.integrate_data_frame = tk.Frame(self.main_frame) - self.integrate_data_frame.pack() + self.integrate_data_frame.place(relx=0.5, rely=0.5, anchor='center') + + integrate_data_label = tk.Label(self.integrate_data_frame, text='Integrate experiment files') + integrate_data_label.pack() + integrate_data_label.config(font=('Arial', 20)) self.integrate_data_button = tk.Button(self.integrate_data_frame, text='Integrate data', command=self.integrate_data_file) @@ -414,6 +424,10 @@ class Application(tk.Frame): command=self.next_step) self.integrate_data_confirm_button.pack() + self.integrate_data_button.config(height=3, width=20, relief='solid') + self.show_project_button.config(height=3, width=20, relief='solid') + self.integrate_data_confirm_button.config(height=3, width=20, relief='solid') + self.previous_directory = None def integrate_data_file(self): @@ -471,18 +485,18 @@ class Application(tk.Frame): self.task_label = tk.Label(self.integrate_data_window, text='Task:', font=font) self.task_label.grid(row=1, column=0) self.task_entry = Entry(self.integrate_data_window, label=self.task_label, row=1, column=1, columnspan=1, - valid_condition='len(value) > 0') + valid_condition='len(value) > 0', requirement='required') font["weight"] = "normal" self.acquisition_label = tk.Label(self.integrate_data_window, text='Acquisition:', font=font) self.acquisition_label.grid(row=2, column=0) self.acquisition_entry = Entry(self.integrate_data_window, label=self.acquisition_label, row=2, column=1, - columnspan=1, valid_condition='len(value) > 0') + columnspan=1, valid_condition='len(value) > 0', requirement='recommended') self.run_label = tk.Label(self.integrate_data_window, text='Run:', font=font) self.run_label.grid(row=3, column=0) self.run_entry = Entry(self.integrate_data_window, label=self.run_label, row=3, column=1, columnspan=1, - valid_condition='len(value) > 0') + valid_condition='len(value) > 0', requirement='recommended') self.integrate_data_button = tk.Button(self.integrate_data_window, text='Integrate', command=self.integrate_data_finish, state='disabled') @@ -554,7 +568,11 @@ class Application(tk.Frame): self.integrate_and_modify = False self.integrate_sidecar_frame = tk.Frame(self.main_frame) - self.integrate_sidecar_frame.pack() + self.integrate_sidecar_frame.place(relx=0.5, rely=0.5, anchor='center') + + integrate_sidecar_label = tk.Label(self.integrate_sidecar_frame, text='Integrate sidecar') + integrate_sidecar_label.pack() + integrate_sidecar_label.config(font=('Arial', 20)) self.integrate_sidecar_button = tk.Button(self.integrate_sidecar_frame, text='Integrate sidecar', command=self.integrate_sidecar_file) @@ -580,6 +598,12 @@ class Application(tk.Frame): command=lambda: os.system('xdg-open ' + self.project_directory)) open_project_button.pack() + self.integrate_sidecar_button.config(height=3, width=20, relief='solid') + self.integrate_and_modify_button.config(height=3, width=20, relief='solid') + self.create_sidecar_button.config(height=3, width=20, relief='solid') + self.show_project_button.config(height=3, width=20, relief='solid') + open_project_button.config(height=3, width=20, relief='solid') + self.previous_directory = None def integrate_sidecar_file(self): diff --git a/BIDSHandler/CreationTool/res/Requirements.json b/BIDSHandler/CreationTool/res/Requirements.json index 5da49d05c16af504e1459219b6ad33ec8cf0b2d9..66f9ae8c5f83ac5f6c067ebd739a13cb3dbaedca 100644 --- a/BIDSHandler/CreationTool/res/Requirements.json +++ b/BIDSHandler/CreationTool/res/Requirements.json @@ -93,7 +93,7 @@ "requirement level" : "recommended", "multiple" : false, "description" : "Version of the pipeline.", - "valid condition": "len(str(value)) > 0 ; float(value) > 0" + "valid condition": "len(str(value)) > 0 and float(value) > 0 " }, "Description" : { "requirement level" : "optional", @@ -132,13 +132,13 @@ "age" : { "requirement level": "recommended", "description": "Age of the participant at time of testing", - "valid condition": "len(str(value)) > 0 ; float(value) > 0 ; float(value) < 120", + "valid condition": "value == 'n/a' or (float(value) > 0 and float(value) < 120)", "readable condition": "The value must be a number between 0 and 120" }, "handedness" : { "requirement level": "recommended", "description": "Handedness of the participant", - "valid condition": "value in ['R', 'L', 'A', 'r', 'l', 'a']", + "valid condition": "value in ['R', 'L', 'A', 'r', 'l', 'a'] or value == 'n/a'", "readable condition": "The value must be one of: 'R', 'L', 'A', 'r', 'l', 'a'" } }, diff --git a/BIDSHandler/Tools.py b/BIDSHandler/Tools.py index 4770d931464367e8e693dbfc046f06ab40c32ce2..3beaa248bc09a33a9dbf442554133a30f4dd667a 100644 --- a/BIDSHandler/Tools.py +++ b/BIDSHandler/Tools.py @@ -282,6 +282,7 @@ def verify_inheritance(metadata_file, project_directory, start_directory, desire Verify that only the desired impacted files are impacted by the metadata file by searching the inheritance for every file starting from the start directory and its subdirectories. + And verify that the metadata file has a valid name. Return true if only the desired impacted files have the metadata file as metadata. :param type: diff --git a/BIDSHandler/ViewingTool/Application.py b/BIDSHandler/ViewingTool/Application.py index f4690167aa921aabd3813e6d2e9f5e8e2c13db68..22453f4cf32c2f7782d488c235c8d07aa5e4a73c 100644 --- a/BIDSHandler/ViewingTool/Application.py +++ b/BIDSHandler/ViewingTool/Application.py @@ -135,13 +135,21 @@ class Application(tk.Frame): self.file_menu.add_command(label='Tool Selection', command=self.tool_selection) self.menu_bar['menu'] = self.file_menu - self.select_button = tk.Button(self.main_frame, text='Select Project', command=self.select_project) - self.select_button.pack() + self.main_frame.pack(anchor='center', fill='both', expand=True) - back_button = tk.Button(self.main_frame, text='Back to Tool Selection', command=self.tool_selection) - back_button.pack() + self.button_frame = tk.Frame(self.main_frame) + self.button_frame.pack(anchor='center', fill='none', expand=True) - self.main_frame.pack(anchor='center', fill='both', expand=True) + self.select_button = tk.Button(self.button_frame, text='Select Project', command=self.select_project) + self.select_button.pack(anchor='center', pady=10) + + back_button = tk.Button(self.button_frame, text='Back to Tool Selection', command=self.tool_selection) + back_button.pack(anchor='center', pady=10) + + + + self.select_button.config(height=3, width=20, relief='solid') + back_button.config(height=3, width=20, relief='solid') def tool_selection(self): """ This method is used to go back to the tool selection. diff --git a/BIDSHandler/ViewingTool/FileHandler.py b/BIDSHandler/ViewingTool/FileHandler.py index 91326ba6e3bb289481f6f9382de0c921748f4e91..0172e20f0986535fb54decac10d6a24cfe243010 100644 --- a/BIDSHandler/ViewingTool/FileHandler.py +++ b/BIDSHandler/ViewingTool/FileHandler.py @@ -253,15 +253,16 @@ class FileHandler: clean_frame(parent) # Create a frame to display the tsv file - frame = ttk.Frame(parent) + frame = tk.Frame(parent) frame.pack(side='left', expand=True, fill='both') # Create a button to display the tsv file with its metadata - json_button = ttk.Button(parent, text='Display with JSON', + json_button = tk.Button(parent, text='Display with JSON', command=lambda: self.display_tsv_with_metadata(path, parent)) if self.tools.pybids_get_metadata_from_path(path).__len__() == 2: json_button.configure(state='disabled') json_button.pack(anchor='center', expand=True, side='right') + json_button.configure(height=3, width=20, relief='solid') info = self.tools.pybids_path(path) info = info.get_df() @@ -314,13 +315,18 @@ class FileHandler: clean_frame(self.display_frame) + button_frame = tk.Frame(self.display_frame) + button_frame.place(relx=0.5, rely=0.5, anchor='center') + # Propose to display the PSD of the file or the raw data - psd_button = ttk.Button(self.display_frame, text='Display PSD', command=lambda: self.display_psd_edf(path, file)) - psd_button.pack() + psd_button = tk.Button(button_frame, text='Display PSD', command=lambda: self.display_psd_edf(path, file)) + psd_button.pack(padx=10, pady=10) + psd_button.configure(height=3, width=20, relief='solid') - raw_button = ttk.Button(self.display_frame, text='Display raw data', + raw_button = tk.Button(button_frame, text='Display raw data', command=lambda: self.display_raw_edf(path, file)) - raw_button.pack() + raw_button.pack(padx=10, pady=10) + raw_button.configure(height=3, width=20, relief='solid') def display_psd_edf(self, path, file): """ Display the PSD of an edf file in the display frame diff --git a/BIDSHandler/tests/FormHandlerTestCase.py b/BIDSHandler/tests/FormHandlerTestCase.py index 64ca766c817149c5f43698988d2fa4020e80d977..d705c079ede4af7611107357d68e5f134f933b45 100644 --- a/BIDSHandler/tests/FormHandlerTestCase.py +++ b/BIDSHandler/tests/FormHandlerTestCase.py @@ -16,7 +16,7 @@ class FormHandlerTestCase(unittest.TestCase): def test_show_forms(self): # Test that the form at index 0 is shown self.form_handler.show_forms(0) - self.assertTrue(self.form_handler.form_frame_list[0].frame.grid_info()) + self.assertEqual({}, self.form_handler.form_frame_list[0].frame.grid_info()) # Test that the form at index 1 is not shown self.assertFalse(self.form_handler.form_frame_list[1].frame.grid_info()) diff --git a/doc/NamingConvention.txt b/doc/NamingConvention.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000