Changes for page 5. How to segment your objects with Webilastik
Last modified by puchades on 2022/09/30 16:01
From version 15.2
edited by tomazvieira
on 2022/01/25 17:22
on 2022/01/25 17:22
Change comment:
There is no comment for this version
To version 15.1
edited by tomazvieira
on 2022/01/25 17:22
on 2022/01/25 17:22
Change comment:
Uploaded new attachment "image-20220125172238-8.png", version {1}
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -31,6 +31,7 @@ 31 31 32 32 [[image:image-20220125164557-4.png]] 33 33 34 +(% class="wikigeneratedid" %) 34 34 == == 35 35 36 36 == Training the Pixel Classifier == ... ... @@ -40,54 +40,47 @@ 40 40 41 41 Pixel Classification uses different characteristics ("features") of your image to determine which class each pixel should belong to. These take into account, for example, color and texture of each pixel as well as that of the neighboring pixels. Each one of this characteristics requires some computational power, which is why you can select only the ones that are sensible for your particular dataset. 42 42 43 -Use the checkboxes in the applet "Select Image Features" applet to select some image features and their corresponding sigma (which determines the radius around the pixel that will be considered when computing that feature). 44 44 45 -You can read more about image features in [[ilastik's documentation.>>https://www.ilastik.org/documentation/pixelclassification/pixelclassification\]] 46 - 47 - 48 -The following is an arbitrary selection of image features. Notice that the checkboxes marked in orange haven't been commited yet; Click Ok to send your feature selections (or deselections) to the server. 49 - 50 -[[image:image-20220125171850-7.png]] 51 - 52 52 === Labeling the image === 53 53 47 +In order to classify the pixels of an image into different classes (e.g.: "foreground and background") ilastik needs you to provide it with samples of each class. To do so, click the brush tool ([[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-122322_28x27_scrot.png?width=28&height=27&rev=1.1||alt="2020-03-31-122322_28x27_scrot.png" height="27" width="28"]]) in the toolbox in Annotations panel, on the right-hand side of the screen. You can select any color for your brush strokes by clicking the color-picker tool, which defaults to a bright yellow([[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-122531_50x28_scrot.png?width=50&height=28&rev=1.1||alt="2020-03-31-122531_50x28_scrot.png" height="28" width="50"]]). 54 54 55 - Inorder toclassifythepixels ofanimageintodifferent classes(e.g.: 'foreground'and'background') ilastikneedsyoutoprovideitwith samplesofeachclass.49 +With the brush tool activated and a suitable color selected, you can start labeling the dataset. For now, the controls for adding annotations to a dataset are the same as for adding any other type of annotation in vanilla Neuroglancer: 56 56 57 -To do so, first select a particular resolution of your dataset (your viewer might interpolate between multiple scales of the dataset, but ilastik operates on a single resolution): 51 +1. Hold Ctrl and click to start a brush stroke; 52 +1. Move the mouse around to draw; 53 +1. While still holding Ctrl, click again to finish the stroke; 58 58 59 - [[image:image-20220125165642-1.png]]55 +Here's an example of a sample dataset with a few brush strokes marking the darker spots in the dataset: 60 60 61 - Onceyou'veselected aresolutiontorainon, you should seeanew "training" tabat thetop oftheiewer:57 +[[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-124011_1276x586_scrot.png?rev=1.2||alt="2020-03-31-124011_1276x586_scrot.png"]] 62 62 63 -[[image:i mage-20220125165832-2.png]]59 +Like in vanilla Neuroglancer, you can snap the navigation back to your annotations by clicking on them in the list of annotations. Note also that the text representing the annotations is colored the same as the color of the brush stroke, and clicking any of the annotations will also set the color picker back to the annotation's color, so that you don't have to remember their hex code. If you're not happy with how one annotation came up, you can delete it by selecting it from the list of annotations and then clicking the trash bin icon([[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-124347_26x21_scrot.png?width=26&height=21&rev=1.1||alt="2020-03-31-124347_26x21_scrot.png" height="21" width="26"]]). 64 64 61 +You must have annotations of at least two different colors in order to have meaningful predictions. 65 65 66 - Youmust havethe"training"tab as thefrontmost visible tab in orderto start adding brush strokes(in neuroglancer you can click the name of the raw data tab to hide it, for example):63 +=== Selecting Features === 67 67 68 - [[image:image-20220125170609-3.png]]65 +ilastik's pixel classifier uses the annotations from the last session as markers of the relevant areas of your image, but it still needs to know which characteristics of those areas are important for deciding which class (i.e. annotation color) a pixel should belong to. Those characteristics are things like the color of the pixel, the color of their neighbors, texture in the neighborhood, etc, and you can learn more about them in the [[relevant ilastik documentation>>url:https://www.ilastik.org/documentation/pixelclassification/pixelclassification#selecting-good-features]]. 69 69 67 +To select which features you want to be used when doing predictions, click the "Features" button ([[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-130413_69x30_scrot.png?width=69&height=30&rev=1.1||alt="2020-03-31-130413_69x30_scrot.png" height="30" width="69"]]) in the toolbox. This will display a window within the annotations side-pannel where you can select features to be calculated, as well as their scales, much like in the native version of ilastik: 70 70 71 - Thestatusdisplayinthisppletwillhow "training[datasource url]"when you'rein trainingmode.69 +[[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-131023_308x237_scrot.png?width=308&height=237&rev=1.1||alt="2020-03-31-131023_308x237_scrot.png" height="237" width="308"]] 72 72 73 - Now youcan startadding brush strokes.Selectacolorfromthecolorpicker,checkthe"EnableBrushing"checkboxtoenablebrushing(anddisablenavigation),andclickanddragovertheimageto add brushstrokes.Ilastik willmap eachused colorto"class", and willtry to figure out assforvery pixelintheimagebasedonthe examples providedbythe brushstrokes.By painting,youprovide ilastikwithsamplesof what apixelin thatparticularclassshouldlook like.Thefollowingimageshows an example with2 classes:teal, representingthe "foreground"orthe"cell class", and magenta, representingthe"background" class.71 +Select features appropriate to your image and the objects you've annotated and click "Ok". Once you have any annotations and at least one feature selected, ilastik will automatically start calculating predictions on your image. Keep in mind, though, that the bigger the region of the image being visualized at any time and the more features you've selected, the longer it will take for the predictions to be calculated. 74 74 75 - [[image:image-20220125171324-4.png]]73 +The next image shows a prediction on the sample data. Notice that the colors match those of your annotations, and are brighter the more confident ilastik is on the class to which they belong. 76 76 77 - Once you have someimagefeaturesselectedand at least onebrush annotation,ilastikwillautomatically use your examples to predict what classes therestof yourdataset shouldbe, displayingtheresults in a"predictions"tab.75 +[[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-131806_1273x584_scrot.png?rev=1.1||alt="2020-03-31-131806_1273x584_scrot.png"]] 78 78 79 -[[image:image-20220125171715-5.png]] 80 - 81 - 82 - 83 83 You can adjust the display settings of the overlay predictions layer as you would in vanilla neuroglancer: 84 84 85 -1. right-click the predictions Neuroglancertab to reveal the "rendering" options86 -1. Adjust the layer opacity to better view the predictions or underlying raw data; 79 +1. right-click the "ilastik predictions" tab to reveal the "rendering" options 80 +1. Adjust the layer opacity to be better view the predictions or underlying raw data; 87 87 1. Advanced users: edit the shader to render the predictions in any arbitrary way; 88 88 89 -The image below shows the "predictions" tab with an opacity set to 0.68 using the steps described above: 83 +The image below shows the "ilastik predictions" tab with an opacity set to 0.68 using the steps described above: 90 90 91 -[[image:i mage-20220125172238-8.png]]85 +[[image:https://wiki.ebrains.eu/bin/download/Collabs/ilastik/ilastik%20online%20classifier%20training/WebHome/2020-03-31-132745_1274x583_scrot.png?rev=1.1||alt="2020-03-31-132745_1274x583_scrot.png"]] 92 92 93 93 You can keep adding or removing features to your model, as well as adding and removing annotations, which will automatically update the predictions tab.