Skip to content

Commit

Permalink
JNB: Change to using datetime for the output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
scottclowe committed Jun 16, 2021
1 parent 0cc6361 commit 1c1b7fa
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 5 deletions.
29 changes: 25 additions & 4 deletions examples/Basic usage - Functional.ipynb
Expand Up @@ -252,12 +252,33 @@
"metadata": {},
"outputs": [],
"source": [
"# Define the folder where FISSA's outputs will be cached.\n",
"# Define the folder where FISSA's outputs will be cached, so they can be\n",
"# quickly reloaded in the future without having to recompute them.\n",
"#\n",
"# This argument is optional; if it is not provided, FISSA will not save its\n",
"# results for later use.\n",
"#\n",
"# Note: you *must* use a different folder for each experiment.\n",
"#\n",
"# In this example, we will use the current datetime as the\n",
"# name of the experiment, but you can name your experiments\n",
"# however you want to.\n",
"\n",
"import datetime\n",
"\n",
"output_folder = \"fissa_example\"\n",
"output_folder = \"fissa-example_{}\".format(\n",
" datetime.datetime.now().strftime(\"%Y-%m-%d_%H-%M-%S\")\n",
")\n",
"\n",
"print(output_folder)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Run FISSA, saving to the output directory\n",
"result = fissa.run_fissa(images_location, rois_location, output_folder)"
]
Expand Down Expand Up @@ -313,7 +334,7 @@
"These interface similarly as `experiment.ROIs`, `experiment.raw`, and `experiment.result` described above. However, Matlab counts from 1 (as opposed to Python counting from 0), such that the ROI, raw trace, and decontaminated trace are all found for cell 0 trial 0 as:\n",
"\n",
"```octave\n",
"data = load(\"fissa_example/matlab.mat\")\n",
"data = load(\"experiment_results.mat\")\n",
"data.ROIs.cell0.trial0{1} % polygon for the ROI\n",
"data.ROIs.cell0.trial0{2} % polygon for first neuropil subregion\n",
"data.result.cell0.trial0(1, :) % final extracted cell signal\n",
Expand Down Expand Up @@ -363,7 +384,7 @@
"alpha = 0.1\n",
"\n",
"# If you change the experiment parameters, you need to change the cache directory too\n",
"output_folder2 = \"fissa_example2\"\n",
"output_folder2 = \"fissa-example-alt\"\n",
"\n",
"# Run FISSA with these parameters\n",
"result = fissa.run_fissa(\n",
Expand Down
29 changes: 28 additions & 1 deletion examples/Basic usage.ipynb
Expand Up @@ -82,7 +82,34 @@
"```\n",
"Defining a different roiset per image can be useful if you need to adjust for motion drift for example.\n",
"\n",
"Then, we can define out experiment:"
"Then, we can define our experiment:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Define the folder where FISSA's outputs will be cached, so they can be\n",
"# quickly reloaded in the future without having to recompute them.\n",
"#\n",
"# This argument is optional; if it is not provided, FISSA will not save its\n",
"# results for later use.\n",
"#\n",
"# Note: you *must* use a different folder for each experiment.\n",
"#\n",
"# In this example, we will use the current datetime as the\n",
"# name of the experiment, but you can name your experiments\n",
"# however you want to.\n",
"\n",
"import datetime\n",
"\n",
"output_folder = \"fissa-example_{}\".format(\n",
" datetime.datetime.now().strftime(\"%Y-%m-%d_%H-%M-%S\")\n",
")\n",
"\n",
"print(output_folder)"
]
},
{
Expand Down

0 comments on commit 1c1b7fa

Please sign in to comment.