From e5a1dc3321b28473f0d65a6f3717ff3f70708890 Mon Sep 17 00:00:00 2001 From: "Guillaume V." Date: Fri, 26 Jun 2026 17:30:44 +0200 Subject: [PATCH 1/2] Update [FreeSurfer] : remove windows-failing input() --- .../freesurfer_longitudinal.ipynb | 84 ++++++++++++++++--- 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb b/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb index a628c7d..06da0af 100644 --- a/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb +++ b/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb @@ -76,12 +76,19 @@ "id": "7817023ff03e7dbf" }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-06-26T15:10:45.074411472Z", + "start_time": "2026-06-26T15:10:44.886206877Z" + } + }, "cell_type": "code", "source": [ "# Built-ins\n", "import tarfile\n", "import shutil\n", + "import ipywidgets as widgets\n", + "from IPython.display import display, clear_output\n", "from pathlib import Path\n", "\n", "# VIP\n", @@ -95,7 +102,7 @@ ], "id": "18aa877afac9a865", "outputs": [], - "execution_count": null + "execution_count": 1 }, { "metadata": {}, @@ -114,7 +121,12 @@ "id": "dd7f54bce66f9e9f" }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-06-26T15:29:52.470396193Z", + "start_time": "2026-06-26T15:29:52.068734048Z" + } + }, "cell_type": "code", "source": [ "CONFIG_PATH = Path('user_config.py')\n", @@ -134,24 +146,72 @@ "GIRDER_OUTPUT_PATH = '/user/USER_NAME/FOLDER_NAME' # Your Girder path to the final outputs folder (must already exist), can be in collections or user folders\n", "\n", "# Local\n", - "LOCAL_DATASET_PATH = Path('~/PATH').expanduser() # Your local dataset path, where the Girder dataset will be downloaded, must already exist\n", + "LOCAL_DATASET_PATH = Path('~/PATH').expanduser() # Your local dataset path, where the Girder dataset will be downloaded, must already exist and be empty. Do not add unrelated custom files in this directory and its subdirectories as it may break vip executions.\n", "LICENSE_PATH = Path('~/PATH/LICENSE_NAME.txt').expanduser() # Your pipeline license path, will be copied into VIP input_dirs automatically\n", "\"\"\"\n", "\n", "if CONFIG_PATH.exists():\n", - " answer = input(\"The user_config.py file already exists. Overwrite config ? (y/N): \")\n", - " if answer != \"y\":\n", - " print(\"File not created, as user_config.py already exists.\")\n", - " else:\n", - " CONFIG_PATH.write_text(user_config)\n", - " print(\"User_config.py overwritten with default values.\")\n", + " print(\"The user_config.py file already exists. Overwrite config ?\")\n", + " out = widgets.Output()\n", + " yes_btn = widgets.Button(description=\"Yes\")\n", + " no_btn = widgets.Button(description=\"No\")\n", + " display(widgets.HBox([yes_btn, no_btn]), out)\n", + " def on_yes(_):\n", + " with out:\n", + " clear_output(wait=True)\n", + " CONFIG_PATH.write_text(user_config)\n", + " print(\"User_config.py overwritten with default values.\")\n", + "\n", + " def on_no(_):\n", + " with out:\n", + " clear_output(wait=True)\n", + " print(\"File not created, as user_config.py already exists.\")\n", + "\n", + " yes_btn.on_click(on_yes)\n", + " no_btn.on_click(on_no)\n", "else:\n", " CONFIG_PATH.write_text(user_config)\n", " print(\"User_config.py created with default values.\")\n" ], "id": "c7f8787950ccc948", - "outputs": [], - "execution_count": null + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The user_config.py file already exists. Overwrite config ?\n" + ] + }, + { + "data": { + "text/plain": [ + "HBox(children=(Button(description='Yes', style=ButtonStyle()), Button(description='No', style=ButtonStyle())))" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "a6cfd041dee64ab8ad69d18223b4a1e0" + } + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "310ebbb135d647559de197da236bc08b" + } + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 36 }, { "metadata": {}, From 38e820b98d3154cd893ce363e35e7f27d6d9fb86 Mon Sep 17 00:00:00 2001 From: "Guillaume V." Date: Fri, 26 Jun 2026 17:33:00 +0200 Subject: [PATCH 2/2] fix --- .../freesurfer_longitudinal.ipynb | 56 ++----------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb b/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb index 06da0af..30d9b89 100644 --- a/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb +++ b/examples/freesurfer/freesurfer_longitudinal_processing/freesurfer_longitudinal.ipynb @@ -76,12 +76,7 @@ "id": "7817023ff03e7dbf" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-06-26T15:10:45.074411472Z", - "start_time": "2026-06-26T15:10:44.886206877Z" - } - }, + "metadata": {}, "cell_type": "code", "source": [ "# Built-ins\n", @@ -102,7 +97,7 @@ ], "id": "18aa877afac9a865", "outputs": [], - "execution_count": 1 + "execution_count": null }, { "metadata": {}, @@ -121,12 +116,7 @@ "id": "dd7f54bce66f9e9f" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-06-26T15:29:52.470396193Z", - "start_time": "2026-06-26T15:29:52.068734048Z" - } - }, + "metadata": {}, "cell_type": "code", "source": [ "CONFIG_PATH = Path('user_config.py')\n", @@ -174,44 +164,8 @@ " print(\"User_config.py created with default values.\")\n" ], "id": "c7f8787950ccc948", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The user_config.py file already exists. Overwrite config ?\n" - ] - }, - { - "data": { - "text/plain": [ - "HBox(children=(Button(description='Yes', style=ButtonStyle()), Button(description='No', style=ButtonStyle())))" - ], - "application/vnd.jupyter.widget-view+json": { - "version_major": 2, - "version_minor": 0, - "model_id": "a6cfd041dee64ab8ad69d18223b4a1e0" - } - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/plain": [ - "Output()" - ], - "application/vnd.jupyter.widget-view+json": { - "version_major": 2, - "version_minor": 0, - "model_id": "310ebbb135d647559de197da236bc08b" - } - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "execution_count": 36 + "outputs": [], + "execution_count": null }, { "metadata": {},