diff --git a/notebooks/ChannelRegistration.ipynb b/notebooks/ChannelRegistration.ipynb index b256fbac..b7794cb2 100644 --- a/notebooks/ChannelRegistration.ipynb +++ b/notebooks/ChannelRegistration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "21d1e58b", + "id": "3a463e61", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -22,7 +22,30 @@ { "cell_type": "code", "execution_count": null, - "id": "b3c2a12b", + "id": "2c8eefa2", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b399241e", "metadata": { "cellView": "form" }, @@ -80,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5c09b00", + "id": "3515d5ba", "metadata": { "cellView": "form" }, @@ -164,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "535b3d44", + "id": "28fd6b5d", "metadata": {}, "source": [ "# Channel Registration Parameters: \n", @@ -182,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c4e28f4", + "id": "cc625efd", "metadata": { "cellView": "form" }, @@ -250,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "ae281b8a", + "id": "0187c8cc", "metadata": {}, "source": [ "## Use the following cell only if you have a previously calculated translation mask\n", @@ -260,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0e91c8c", + "id": "b7fa2ef3", "metadata": { "cellView": "form" }, diff --git a/notebooks/DriftCorrection.ipynb b/notebooks/DriftCorrection.ipynb index 5c942f05..da2cf2f4 100644 --- a/notebooks/DriftCorrection.ipynb +++ b/notebooks/DriftCorrection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4a8ab58f", + "id": "8000d90a", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -22,7 +22,30 @@ { "cell_type": "code", "execution_count": null, - "id": "80886110", + "id": "8e6267d8", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8a1ec6e4", "metadata": { "cellView": "form" }, @@ -80,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d8288ff", + "id": "cd931d80", "metadata": { "cellView": "form" }, @@ -164,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "c800a0e9", + "id": "c64af72e", "metadata": {}, "source": [ "# Drift Correction Parameters: \n", @@ -181,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2d6671a", + "id": "6e00f92e", "metadata": { "cellView": "form" }, @@ -274,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "60fc5a28", + "id": "4dee37ed", "metadata": {}, "source": [ "## Use the following cell only if you have a previously calculated drift table\n", @@ -284,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45dc3ea1", + "id": "e68d4a71", "metadata": { "cellView": "form" }, diff --git a/notebooks/ExampleDataSRRFandQC.ipynb b/notebooks/ExampleDataSRRFandQC.ipynb index 1ec6d8e1..e4e7395a 100644 --- a/notebooks/ExampleDataSRRFandQC.ipynb +++ b/notebooks/ExampleDataSRRFandQC.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ccf59fd6", + "id": "0bb114f6", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -26,7 +26,30 @@ { "cell_type": "code", "execution_count": null, - "id": "ac16d462", + "id": "9b1d5a74", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf06f12f", "metadata": { "cellView": "form" }, @@ -83,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "b589d195", + "id": "9b40447a", "metadata": {}, "source": [ "## Next lets create the Data Loader GUI.\n", @@ -94,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "894a6951", + "id": "0facb763", "metadata": { "cellView": "form" }, @@ -178,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "517e4a79", + "id": "9c6e9ba9", "metadata": {}, "source": [ "## Now let's use SRRF to generate a super-resolution image\n", @@ -187,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "b2b2ef21", + "id": "5d3afd30", "metadata": {}, "source": [ "# SRRF Parameters:\n", @@ -203,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7fc2972", + "id": "ad5edeff", "metadata": { "cellView": "form" }, @@ -311,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "41180535", + "id": "e32a84cf", "metadata": {}, "source": [ "## Let's use NanoPyx to generate an error map of the SRRF image\n", @@ -321,7 +344,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab02d527", + "id": "44184399", "metadata": { "cellView": "form" }, @@ -476,7 +499,7 @@ }, { "cell_type": "markdown", - "id": "40f389f4", + "id": "c954bc0c", "metadata": {}, "source": [ "## Let's compare the resolution of the raw data with the SRRF using FRC and DecorrelationAnalysis. Let's start with calculation the FRC resolution of the raw data (select frame 3 and 11).\n", @@ -485,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "b3b9ce84", + "id": "03d6c564", "metadata": {}, "source": [ "# FRC Parameters:\n", @@ -500,7 +523,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ef9e176", + "id": "3bc9fcaf", "metadata": { "cellView": "form" }, @@ -560,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "3be3aa0a", + "id": "c064f783", "metadata": {}, "source": [ "## Now do the same for the SRRF image\n", @@ -570,7 +593,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c364a56", + "id": "a15491c4", "metadata": { "cellView": "form" }, @@ -630,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "611e7ff7", + "id": "b070890b", "metadata": {}, "source": [ "## Let's do the same using Decorrelation analysis\n", @@ -639,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "19efd107", + "id": "9cf3dcf4", "metadata": {}, "source": [ "# Image Decorrelation Analysis Parameters:\n", @@ -655,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72263010", + "id": "bd63a8fe", "metadata": { "cellView": "form" }, @@ -716,7 +739,7 @@ }, { "cell_type": "markdown", - "id": "4c0790e7", + "id": "adb0d906", "metadata": {}, "source": [ "## Now let's measure the resolution of the generated SRRF image using Decorrelation analysis\n", @@ -726,7 +749,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b87c1750", + "id": "c467203c", "metadata": { "cellView": "form" }, diff --git a/notebooks/NonLocalMeansDenoising.ipynb b/notebooks/NonLocalMeansDenoising.ipynb index 4fe964b1..784ae4c5 100644 --- a/notebooks/NonLocalMeansDenoising.ipynb +++ b/notebooks/NonLocalMeansDenoising.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d6df60cd", + "id": "4add2b4d", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -23,7 +23,30 @@ { "cell_type": "code", "execution_count": null, - "id": "a63bd5aa", + "id": "09454d17", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ffa7c053", "metadata": { "cellView": "form" }, @@ -81,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d66588d", + "id": "8153398f", "metadata": { "cellView": "form" }, @@ -165,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "479327f7", + "id": "1b5bb6d3", "metadata": {}, "source": [ "# Use Non-local means denoising on selected data\n", @@ -182,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66b826f8", + "id": "0888b1fe", "metadata": { "cellView": "form" }, diff --git a/notebooks/ParamSweepandeSRRF.ipynb b/notebooks/ParamSweepandeSRRF.ipynb index b6aab1fa..d1ce9e02 100644 --- a/notebooks/ParamSweepandeSRRF.ipynb +++ b/notebooks/ParamSweepandeSRRF.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0c5fd2df", + "id": "8047889c", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -28,7 +28,30 @@ { "cell_type": "code", "execution_count": null, - "id": "5ee4bab7", + "id": "a0d63f0d", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43026c0e", "metadata": { "cellView": "form" }, @@ -86,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae1cf4a9", + "id": "775998a4", "metadata": { "cellView": "form" }, @@ -170,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "0c6ad675", + "id": "74595e53", "metadata": {}, "source": [ "# Run a parameter sweep to find the best combination of parameters\n", @@ -187,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b49653f3", + "id": "a5f70766", "metadata": { "cellView": "form" }, @@ -252,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "619081d0", + "id": "eb09c35a", "metadata": { "cellView": "form" }, @@ -392,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "a718a9a5", + "id": "54fbdd6a", "metadata": {}, "source": [ "## Calculate error map for the eSRRF image\n", @@ -402,7 +425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d1042a", + "id": "2fd58492", "metadata": { "cellView": "form" }, @@ -557,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "7acada4e", + "id": "ee07fd90", "metadata": {}, "source": [ "## Calculate FRC resolution of the diffraction limited image\n", @@ -573,7 +596,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c44bfc2", + "id": "674861a8", "metadata": { "cellView": "form" }, @@ -633,7 +656,7 @@ }, { "cell_type": "markdown", - "id": "7a8c60d9", + "id": "d4b7bb70", "metadata": {}, "source": [ "## Calculate FRC resolution of the SR image\n", @@ -649,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18f5b749", + "id": "9e2c0164", "metadata": { "cellView": "form" }, @@ -709,7 +732,7 @@ }, { "cell_type": "markdown", - "id": "dfb690d0", + "id": "765431c5", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the diffraction limited image\n", @@ -726,7 +749,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6eccdf8", + "id": "abc6f7eb", "metadata": { "cellView": "form" }, @@ -787,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "290a5fc0", + "id": "4fccd529", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the SR image\n", @@ -804,7 +827,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60a23520", + "id": "02da8d00", "metadata": { "cellView": "form" }, diff --git a/notebooks/SRMetrics.ipynb b/notebooks/SRMetrics.ipynb index fc0034c6..3736e701 100644 --- a/notebooks/SRMetrics.ipynb +++ b/notebooks/SRMetrics.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9742f460", + "id": "97e5fd86", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -26,7 +26,30 @@ { "cell_type": "code", "execution_count": null, - "id": "ce41f905", + "id": "951d88a7", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f45244bb", "metadata": { "cellView": "form" }, @@ -83,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "5feab865", + "id": "3fdade62", "metadata": {}, "source": [ "## Load difraction limited image (only needed if you want to use the FRC and Decorrelation analysis on this image or if you want to perform the Error Map analysis)\n", @@ -93,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5bb0805", + "id": "ca1e5bec", "metadata": { "cellView": "form" }, @@ -177,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "f3e45bcc", + "id": "664ed11e", "metadata": {}, "source": [ "## Load super-resolved image\n", @@ -187,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79311067", + "id": "8e442e2e", "metadata": { "cellView": "form" }, @@ -271,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "830472cd", + "id": "67256b12", "metadata": {}, "source": [ "## Calculate Error Map\n", @@ -281,7 +304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10d68395", + "id": "9459ed67", "metadata": { "cellView": "form" }, @@ -436,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "91e0077b", + "id": "43e793e6", "metadata": {}, "source": [ "# Calculate FRC of the diffraction limited image\n", @@ -452,7 +475,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd5f7912", + "id": "64b5bca2", "metadata": { "cellView": "form" }, @@ -512,7 +535,7 @@ }, { "cell_type": "markdown", - "id": "6bd57aae", + "id": "74a8584c", "metadata": {}, "source": [ "# Calculate FRC of the SR image\n", @@ -528,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "688b043c", + "id": "975eed33", "metadata": { "cellView": "form" }, @@ -588,7 +611,7 @@ }, { "cell_type": "markdown", - "id": "e7fe12d3", + "id": "e4344b4a", "metadata": {}, "source": [ "# Calculate Decorrelation analysis of diffraction limited image\n", @@ -605,7 +628,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fc498d0", + "id": "5924d95f", "metadata": { "cellView": "form" }, @@ -666,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "61efd725", + "id": "a9ff5221", "metadata": {}, "source": [ "# Calculate Decorrelation analysis of SR image\n", @@ -683,7 +706,7 @@ { "cell_type": "code", "execution_count": null, - "id": "812b3075", + "id": "fed6f580", "metadata": { "cellView": "form" }, diff --git a/notebooks/SRRFandQC.ipynb b/notebooks/SRRFandQC.ipynb index 4c169f13..e6545c90 100644 --- a/notebooks/SRRFandQC.ipynb +++ b/notebooks/SRRFandQC.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "127bc22a", + "id": "a0c4a106", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -28,7 +28,30 @@ { "cell_type": "code", "execution_count": null, - "id": "f649e22a", + "id": "378e76be", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "093cec67", "metadata": { "cellView": "form" }, @@ -86,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab45f6e3", + "id": "303b232b", "metadata": { "cellView": "form" }, @@ -170,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "988237bc", + "id": "f1ad7f42", "metadata": {}, "source": [ "# Use SRRF to generate a super-resolved image\n", @@ -187,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1efcc50d", + "id": "3c82b75d", "metadata": { "cellView": "form" }, @@ -295,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "e9c6c1cd", + "id": "08a8cd23", "metadata": {}, "source": [ "## Calculate error map for the SRRF image\n", @@ -305,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b68a496e", + "id": "ee868b6a", "metadata": { "cellView": "form" }, @@ -460,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "d5cfb112", + "id": "b83edb6a", "metadata": {}, "source": [ "## Calculate FRC resolution of the diffraction limited image\n", @@ -476,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cd4c902", + "id": "267e9345", "metadata": { "cellView": "form" }, @@ -536,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "0e2e01fb", + "id": "d9c9df13", "metadata": {}, "source": [ "## Calculate FRC resolution of the SR image\n", @@ -552,7 +575,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69644270", + "id": "f4b3a01b", "metadata": { "cellView": "form" }, @@ -612,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "76beec23", + "id": "d3de6597", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the diffraction limited image\n", @@ -629,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e47e802d", + "id": "298b3cea", "metadata": { "cellView": "form" }, @@ -690,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "dc0f812e", + "id": "aba479b1", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the SR image\n", @@ -707,7 +730,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12dd4e97", + "id": "c050dbdd", "metadata": { "cellView": "form" }, diff --git a/notebooks/eSRRFandQC.ipynb b/notebooks/eSRRFandQC.ipynb index 1b8c0946..7be611a1 100644 --- a/notebooks/eSRRFandQC.ipynb +++ b/notebooks/eSRRFandQC.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "91304c56", + "id": "8416580c", "metadata": {}, "source": [ "# NanoPyx \"Codeless\" Jupyter Notebook\n", @@ -28,7 +28,30 @@ { "cell_type": "code", "execution_count": null, - "id": "a4b967bf", + "id": "117138df", + "metadata": { + "cellView": "form" + }, + "outputs": [], + "source": [ + "#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell.\n", + "import sys\n", + "IN_COLAB = 'google.colab' in sys.modules\n", + "if IN_COLAB:\n", + " !pip install -q numpy==1.26.4\n", + " !pip install -q mako==1.3.0\n", + "\n", + " print(\"Session will now restart automatically. You can then proceed to the next cell.\")\n", + " import os\n", + " os.kill(os.getpid(), 9)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f8d47fc3", "metadata": { "cellView": "form" }, @@ -86,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28c5296b", + "id": "16c0ffe7", "metadata": { "cellView": "form" }, @@ -170,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "cc7a9fd5", + "id": "ac124508", "metadata": {}, "source": [ "# Use eSRRF to generate a super-resolved image\n", @@ -187,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "429e61b2", + "id": "d31adb14", "metadata": { "cellView": "form" }, @@ -327,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "7ddaa874", + "id": "6688cee1", "metadata": {}, "source": [ "## Calculate error map for the eSRRF image\n", @@ -337,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf50f12", + "id": "654a97c7", "metadata": { "cellView": "form" }, @@ -492,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "85b87835", + "id": "cae6921f", "metadata": {}, "source": [ "## Calculate FRC resolution of the diffraction limited image\n", @@ -508,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d116e1d7", + "id": "f767f72e", "metadata": { "cellView": "form" }, @@ -568,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "a46f41b3", + "id": "b277a488", "metadata": {}, "source": [ "## Calculate FRC resolution of the SR image\n", @@ -584,7 +607,7 @@ { "cell_type": "code", "execution_count": null, - "id": "989f8a2f", + "id": "60ed9d03", "metadata": { "cellView": "form" }, @@ -644,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "0099c8b9", + "id": "e69fce14", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the diffraction limited image\n", @@ -661,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa7fe62", + "id": "5a627d33", "metadata": { "cellView": "form" }, @@ -722,7 +745,7 @@ }, { "cell_type": "markdown", - "id": "b602fb43", + "id": "b63fc518", "metadata": {}, "source": [ "## Calculate Decorrelation analysis resolution of the SR image\n", @@ -739,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3e04bb2", + "id": "adfb20e3", "metadata": { "cellView": "form" }, diff --git a/src/notebookchef/pantry/colab_numpy_fix.py b/src/notebookchef/pantry/colab_numpy_fix.py new file mode 100644 index 00000000..2702fefe --- /dev/null +++ b/src/notebookchef/pantry/colab_numpy_fix.py @@ -0,0 +1,10 @@ +#@title Fix numpy version in Google Colab, can be skipped if running in local environment. Session will now restart automatically. You can then proceed to the next cell. +import sys +IN_COLAB = 'google.colab' in sys.modules +if IN_COLAB: + !pip install -q numpy==1.26.4 + !pip install -q mako==1.3.0 + + print("Session will now restart automatically. You can then proceed to the next cell.") + import os + os.kill(os.getpid(), 9) \ No newline at end of file diff --git a/src/notebookchef/recipes/ChannelRegistration.txt b/src/notebookchef/recipes/ChannelRegistration.txt index d6718fbd..7f81868f 100644 --- a/src/notebookchef/recipes/ChannelRegistration.txt +++ b/src/notebookchef/recipes/ChannelRegistration.txt @@ -7,6 +7,9 @@ $include: notebook_intro.txt $include: citations/channel_registration.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code diff --git a/src/notebookchef/recipes/DriftCorrection.txt b/src/notebookchef/recipes/DriftCorrection.txt index c01b3c69..13342d48 100644 --- a/src/notebookchef/recipes/DriftCorrection.txt +++ b/src/notebookchef/recipes/DriftCorrection.txt @@ -7,6 +7,9 @@ $include: notebook_intro.txt $include: citations/drift_correction.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code diff --git a/src/notebookchef/recipes/ExampleDataSRRFandQC.txt b/src/notebookchef/recipes/ExampleDataSRRFandQC.txt index a695743b..da68305c 100644 --- a/src/notebookchef/recipes/ExampleDataSRRFandQC.txt +++ b/src/notebookchef/recipes/ExampleDataSRRFandQC.txt @@ -9,6 +9,9 @@ $include: citations/frc.txt $include: citations/decorr.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $markdown diff --git a/src/notebookchef/recipes/NonLocalMeansDenoising.txt b/src/notebookchef/recipes/NonLocalMeansDenoising.txt index cc1ab889..46e669f9 100644 --- a/src/notebookchef/recipes/NonLocalMeansDenoising.txt +++ b/src/notebookchef/recipes/NonLocalMeansDenoising.txt @@ -7,6 +7,9 @@ $include: notebook_intro.txt $include: citations/nlm_denoising.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code diff --git a/src/notebookchef/recipes/ParamSweepandeSRRF.txt b/src/notebookchef/recipes/ParamSweepandeSRRF.txt index d608dc2d..95d90d02 100644 --- a/src/notebookchef/recipes/ParamSweepandeSRRF.txt +++ b/src/notebookchef/recipes/ParamSweepandeSRRF.txt @@ -10,6 +10,9 @@ $include: citations/frc.txt $include: citations/decorr.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code diff --git a/src/notebookchef/recipes/SRMetrics.txt b/src/notebookchef/recipes/SRMetrics.txt index 52bd849d..3a1fff53 100644 --- a/src/notebookchef/recipes/SRMetrics.txt +++ b/src/notebookchef/recipes/SRMetrics.txt @@ -9,6 +9,9 @@ $include: citations/frc.txt $include: citations/decorr.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $markdown diff --git a/src/notebookchef/recipes/SRRFandQC.txt b/src/notebookchef/recipes/SRRFandQC.txt index 8c7b22b2..09ae7840 100644 --- a/src/notebookchef/recipes/SRRFandQC.txt +++ b/src/notebookchef/recipes/SRRFandQC.txt @@ -10,6 +10,9 @@ $include: citations/frc.txt $include: citations/decorr.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code diff --git a/src/notebookchef/recipes/eSRRFandQC.txt b/src/notebookchef/recipes/eSRRFandQC.txt index dacc4157..feab0796 100644 --- a/src/notebookchef/recipes/eSRRFandQC.txt +++ b/src/notebookchef/recipes/eSRRFandQC.txt @@ -10,6 +10,9 @@ $include: citations/frc.txt $include: citations/decorr.txt __cellbreak__ $code +$include: colab_numpy_fix.py +__cellbreak__ +$code $include: notebook_setup.py __cellbreak__ $code