Skip to content

Commit eac3169

Browse files
authored
Relocate input module section (#124)
* move input modules to the end To avoid ppl getting stuck on this optional step, I moved it to the end of the tutorial. * Add welcome message so that ppl have a more clear sign that "something happened" when they load the segmentation_start.cppipe * update pdf version (english) * add pipeline overview figure
1 parent d960b12 commit eac3169

File tree

4 files changed

+82
-67
lines changed

4 files changed

+82
-67
lines changed
Binary file not shown.

BeginnerSegmentation/segmentation_start.cppipe

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GitHash:
55
ModuleCount:4
66
HasImagePlaneDetails:False
77

8-
Images:[module_num:1|svn_version:'Unknown'|variable_revision_number:2|show_window:False|notes:['To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.', '', 'Drag and drop your IMAGES (you can drag and drop the entire "images_Illum-corrected" folder) into the panel just below this one.', '', '<-Drag and drop your "segmentation_start.cppipe" files into the left panel.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
8+
Images:[module_num:1|svn_version:'Unknown'|variable_revision_number:2|show_window:False|notes:['WELCOME TO THE BEGGINNER SEGMENTATION TUTORIAL!! :D', '', 'To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.', 'Drag and drop your IMAGES (you can drag and drop the entire "images_Illum-corrected" folder) into the panel just below this one.', '', '<-Drag and drop your "segmentation_start.cppipe" files into the left panel.']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]
99
:
1010
Filter images?:Images only
1111
Select the rule criteria:or (extension does isimage) (file does contain ".npy")

internal_use/docs/source/BeginnerSegmentation/CPbeginner_Segmentation.md

+81-66
Original file line numberDiff line numberDiff line change
@@ -86,75 +86,14 @@ Read through the steps below and follow instructions where stated. Steps where y
8686
> **TIP** you can manually adjust brightness and contrast in the image display by right-clicking on it and going to `'Adjust Contrast'`
8787
8888
-------------------------------------------------------------------------------------------------------------------------
89-
### **3. [OPTIONAL STEP] Set up the input modules (10min)**
89+
### 3. [OPTIONAL STEP] Set up the input modules
9090

91-
> *You can skip this step ig you prefer, it will not affect the rest of the pipeline, as these modules have been properly set up in the starting pipeline.*
92-
93-
The four input modules (**Images**, **Metadata**, **NamesAndTypes**, and **Groups**) are crucial for any CellProfiler pipeline because they define how images are loaded and organized.
94-
95-
- The **Metadata** module is already configured. With it, you can extract information that is required for you analysis and which is not contained within the images themselves (thus, the name 'Metadata'):
96-
97-
- In this case, the module extracts the **Plate**, **Well**, **Site** and **ChannelNumber** from the image files' names.
98-
99-
- This situation is a rather simple one, but if your own data is more complex, there are other ways of obtaining metadata. You can `Add another extraction method` and choose which images to apply them to.
100-
- You can also add a file which adds extra Metadata per image.
101-
102-
- The module uses a `'regular expression'` (also known as RegEx), a sort of template that fits all the file names and allows to obtain data from them.
103-
104-
- Click on the magnifying glass at the end of the regular expression box for each extraction method to see how it works.
105-
106-
- Let's analyze the example used in this tutorial:
107-
>**`^(?P<Plate>.*)_(?P<Well>[A-P]{1}[0-9]{2})_site(?P<Site>[0-9])_Ch(?P<ChannelNumber>[1-5]).tif`**
108-
109-
> Expressions contained between parentheses are VARIABLE and are captured into named variables (denoted as `(?P<VariableName>)`).
110-
>
111-
> Expressions outside parentheses are CONSTANT and should be present in ALL image file names (like the underscores and the '.tif')
112-
>
113-
> `^`: Start the regular expression
114-
>
115-
>`(?P<Plate>.*)`: Extract all the characters before the first underscore character (_) and assign them to the measurement **"Plate"** for the image.
116-
>
117-
>`(?P<Well>[A-P]{1}[0-9]{2})`: Extract a single (denoted as {1}) uppercase letter from A to P (denoted as [A-P]). Then, extract the next two digits ({2}) between [0-9] and assign it to the measurment **"Well"** for the image.
118-
>
119-
>`site(?P<Site>[0-9])`: After the constant string "site", extract the next two digits {2} between [0-9] and assign it to the measurement **"Site"** for the image.
120-
>
121-
>`Ch(?P<ChannelNumber>[1-5])`: After the constant string "Ch", extract the next digit between [1-5] and assign it to the measurement **"ChannelNumber"** for the image.
122-
123-
>If you want to learn more about how these regular expressions work or how to adapt them to other situations, click on the <img src="./TutorialImages/Info.png" width="35"> button.
124-
125-
```{figure} ./TutorialImages/Fig4.png
126-
:width: 650
127-
:align: center
128-
129-
*Figure 4: The **Metadata** module, columns in table correspond to metadata categories*
130-
```
131-
132-
- In the **NamesAndTypes** module, we assign names to the images and configure image sets (i.e., all the different channels for a field of view). We will use the metadata we extracted in the previous module to make that association possible.
133-
134-
- This module is also fully configured already, but scroll and look through the configuration to see how we use the **ChannelNumber** obtained from the **Metadata** module to assign names to each image (There are several other ways to create correct mappings, but these may serve as a helpful example to refer to in your own work).
135-
136-
137-
```{figure} ./TutorialImages/Fig5.png
138-
:width: 800
139-
:align: center
140-
141-
*Figure 5: Image mapping using extracted metadata*
142-
```
143-
144-
- Scroll to the bottom of the **NamesAndTypes** module settings to see how the image sets are constructed ‘`Image set matching’` is set to `‘Metadata’`. Each image channel is set to ‘Well → Site’.
145-
146-
147-
```{figure} ./TutorialImages/Fig6.png
148-
:width: 800
149-
:align: center
150-
151-
*Figure 6: Image set matching using extracted metadata*
152-
```
153-
154-
- For this exercise the **Groups** module is not needed so it is set to ‘No’, this module can be useful when you have more than one plate, or different movies.
91+
> *We suggest you skip this step for now, it will not affect the rest of the pipeline, as these modules have been properly set up in the starting pipeline (`segmentation_start.cpipe`).*
92+
93+
> *At the end of this tutorial you will find instructions on how to set up the input modules*
15594
156-
> **For more information and examples on how to configure the Input modules we have created a blog and video tutorial that can be accessed [here](https://carpenter-singh-lab.broadinstitute.org/blog/input-modules-tutorial).**
15795
--------------------------------------------------------------------------------------------------------------------------
96+
------------------------
15897

15998
## Build the analysis pipeline
16099

@@ -178,6 +117,13 @@ Thus, the order in which this processes are executed is **very** important, as i
178117
The usefulness of building a pipeline is that you can apply the same series of processing/analysis steps to all the image dataset, which makes the analysis both fast and reproducible. However, while constructing the pipeline, we don't want to run our unfinished pipeline on ALL the images every time we try something new. That's why CellProfiler has a `'Test Mode'`, which allows you to run every step individually and separately one a SINGLE IMAGE at a time. Once your pipeline has at least one non-input module in it, you can activate this mode by clicking on <img src="./TutorialImages/startTestMode.png" width="120"/> in the lower-left of the window.
179118
When you are done developing your pipeline, you can exit the `'Test Mode'` by clicking on <img src="./TutorialImages/exitTestMode.png" width="120"/> and then finally run the entire pipeline on your complete image dataset using the <img src="./TutorialImages/analyzeImages.png" width="120"/> button.
180119

120+
```{figure} ./TutorialImages/BeginnerPipelineSummary.png
121+
:width: 700
122+
:align: center
123+
124+
*Overview of the final **pipeline** that you will be building with the general aim of each section*
125+
```
126+
181127
### **4. IdentifyPrimaryObjects – Nuclei (10min)**
182128

183129
> **AIM: use the nuclear channel to segment (isolate and identify all the pixels belonging to) each nuclei.**
@@ -486,3 +432,72 @@ Now you have a pipeline that works well across different images. It is time to r
486432
<br>
487433

488434
**CONGRATULATIONS!! YOU HAVE SUCCESSFULLY RUN YOUR FIRST CELL PROFILER PIPELINE!**
435+
436+
------------------------------------------------------------------------------------
437+
---------------------------------------------------------------------------------------
438+
### **3. [OPTIONAL] Set up the input modules (10min)**
439+
440+
The four input modules (**Images**, **Metadata**, **NamesAndTypes**, and **Groups**) are crucial for any CellProfiler pipeline because they define how images are loaded and organized.
441+
442+
- The **Metadata** module is already configured. With it, you can extract information that is required for you analysis and which is not contained within the images themselves (thus, the name 'Metadata'):
443+
444+
- In this case, the module extracts the **Plate**, **Well**, **Site** and **ChannelNumber** from the image files' names.
445+
446+
- This situation is a rather simple one, but if your own data is more complex, there are other ways of obtaining metadata. You can `Add another extraction method` and choose which images to apply them to.
447+
- You can also add a file which adds extra Metadata per image.
448+
449+
- The module uses a `'regular expression'` (also known as RegEx), a sort of template that fits all the file names and allows to obtain data from them.
450+
451+
- Click on the magnifying glass at the end of the regular expression box for each extraction method to see how it works.
452+
453+
- Let's analyze the example used in this tutorial:
454+
>**`^(?P<Plate>.*)_(?P<Well>[A-P]{1}[0-9]{2})_site(?P<Site>[0-9])_Ch(?P<ChannelNumber>[1-5]).tif`**
455+
456+
> Expressions contained between parentheses are VARIABLE and are captured into named variables (denoted as `(?P<VariableName>)`).
457+
>
458+
> Expressions outside parentheses are CONSTANT and should be present in ALL image file names (like the underscores and the '.tif')
459+
>
460+
> `^`: Start the regular expression
461+
>
462+
>`(?P<Plate>.*)`: Extract all the characters before the first underscore character (_) and assign them to the measurement **"Plate"** for the image.
463+
>
464+
>`(?P<Well>[A-P]{1}[0-9]{2})`: Extract a single (denoted as {1}) uppercase letter from A to P (denoted as [A-P]). Then, extract the next two digits ({2}) between [0-9] and assign it to the measurment **"Well"** for the image.
465+
>
466+
>`site(?P<Site>[0-9])`: After the constant string "site", extract the next two digits {2} between [0-9] and assign it to the measurement **"Site"** for the image.
467+
>
468+
>`Ch(?P<ChannelNumber>[1-5])`: After the constant string "Ch", extract the next digit between [1-5] and assign it to the measurement **"ChannelNumber"** for the image.
469+
470+
>If you want to learn more about how these regular expressions work or how to adapt them to other situations, click on the <img src="./TutorialImages/Info.png" width="35"> button.
471+
472+
```{figure} ./TutorialImages/Fig4.png
473+
:width: 650
474+
:align: center
475+
476+
*Figure 4: The **Metadata** module, columns in table correspond to metadata categories*
477+
```
478+
479+
- In the **NamesAndTypes** module, we assign names to the images and configure image sets (i.e., all the different channels for a field of view). We will use the metadata we extracted in the previous module to make that association possible.
480+
481+
- This module is also fully configured already, but scroll and look through the configuration to see how we use the **ChannelNumber** obtained from the **Metadata** module to assign names to each image (There are several other ways to create correct mappings, but these may serve as a helpful example to refer to in your own work).
482+
483+
484+
```{figure} ./TutorialImages/Fig5.png
485+
:width: 800
486+
:align: center
487+
488+
*Figure 5: Image mapping using extracted metadata*
489+
```
490+
491+
- Scroll to the bottom of the **NamesAndTypes** module settings to see how the image sets are constructed ‘`Image set matching’` is set to `‘Metadata’`. Each image channel is set to ‘Well → Site’.
492+
493+
494+
```{figure} ./TutorialImages/Fig6.png
495+
:width: 800
496+
:align: center
497+
498+
*Figure 6: Image set matching using extracted metadata*
499+
```
500+
501+
- For this exercise the **Groups** module is not needed so it is set to ‘No’, this module can be useful when you have more than one plate, or different movies.
502+
503+
> **For more information and examples on how to configure the Input modules we have created a blog and video tutorial that can be accessed [here](https://carpenter-singh-lab.broadinstitute.org/blog/input-modules-tutorial).**
Loading

0 commit comments

Comments
 (0)