<commit_before># First Use of TissueMiner with your own data

### 1. First, organize your movie images as follow

* **Create a movie_repository** folder where to centralize all of your movies
    + Inside this folder, **create one movie folder per movie**
        + inside each movie folder, **create a "Segmentation" folder** where to store you movie images
            + the **name of movie images** is composed of the movie name followed by an underscore and a frame number 

The data organization is summarized as follow:

`<movie_repository>/<movie_directory>/Segmentation/<movie_directory_name>_%03d.png`


where %03d represents a frame number padded with 3 digits. The number of digits can be modified, see [FAQ](https://github.com/mpicbg-scicomp/tissue_miner/blob/master/faq.md).

* The image type should be **8-bit** or **RGB**.
* The image format should be **png** or **tiff**


### 2. Segment and track cells using TissueAnalyzer

**Tissue Analyzer** (copyright Aigouy 2016) ships with its own licence
(see license_TA.txt bundled in the software). Tissue Analyzer should not be modified or
reverse engineered.  Tissue Analyzer should always be distributed
bundled with **TissueMiner** and not alone.

You can install the latest version of Tissue Analyzer (formerly known
as Packing Analyzer) within FIJI (http://fiji.sc/Fiji). To do so:

* launch FIJI
* open the "Help" menu
* click on "Update..."
* click on "Manage update sites"
* click on "Add" and enter "http://sites.imagej.net/TA/" in the URL field (and anything you like in the "Name" field)
* click "Close" and FIJI should offer you to install TA.

Once the installation is complete, restart FIJI, open the "Plugins" menu and click on "Tissue Analyzer"

For a quick start guide, click [here](https://github.com/mpicbg-scicomp/tissue_miner/blob/master/docs/TAdoc.pdf)


### 3. Optionally, define regions of interest (ROI's) and orient the tissue along the x or y axis
To this purpose, we provide two [FIJI](http://fiji.sc/) programs ***draw_n_get_ROIcoord.ijm*** and ***orient_tissue.ijm***.

#### 3.1 Define ROI's:
* launch FIJI
* go to the ***fiji_macros*** folder located in your TissueMiner installation folder
* drap-and-drop the ***draw_n_get_ROIcoord.ijm*** file into FIJI
* a script editor opens automatically
* click **RUN** and define your ROI's   

By default, TissueMiner always creates two ROI's: 

* "raw": corresponds to all segmented and tracked cells
* "whole_tissue": corresponds to cell lineages that remain in the field of view



#### 3.2 Orient the tissue
* launch FIJI
* go to the ***fiji_macros*** folder located in your TissueMiner installation folder
* drap-and-drop the ***orient_tissue.ijm*** file into FIJI
* a script editor opens automatically
* click **RUN** and define the tissue axis to be aligned on x or y. 

Both programs automatically save a text file (LastFrameRoi.txt and transformation.txt, respectively). If these files are present, TissueMiner will take them into account for further precessing steps.


### 4. Open a terminal

* You'll find it either in your application menu or application folder (depending on your system):

![alt tag](../../readme_screenshots/docker_toolbox_osx_quickstart_icon_nolabel.png)


### 5. Go to the movie directory

* Browse your data to find the **movie folder**
* **In your terminal** type in ***cd*** and a **space**
* and drag-and-drop the **movie folder** into the terminal

Summary:
`cd <path_to_movie_folder>`

* Set up the docker command and store it in a shell variable for simplicity
`DOCKER="docker run --rm -ti -v $(dirname $PWD):/movies -w /movies/$(basename $PWD) etournay/tissue_miner"`

### 6. Select the analysis you are interested in
Here, we propose some streamlined quickstart tutorials.<commit_msg>cosmetics<commit_after># First Use of TissueMiner with your own data

### 1. First, organize your movie images as follow

* **Create a movie_repository** folder where to centralize all of your movies
    + Inside this folder, **create one movie folder per movie**
        + inside each movie folder, **create a "Segmentation" folder** where to store you movie images
            + the **name of movie images** is composed of the movie name followed by an underscore and a frame number 

The data organization is summarized as follow:

`<movie_repository>/<movie_directory>/Segmentation/<movie_directory_name>_%03d.png`


where %03d represents a frame number padded with 3 digits. The number of digits can be modified, see [FAQ](https://github.com/mpicbg-scicomp/tissue_miner/blob/master/faq.md).

* The image type should be **8-bit** or **RGB**.
* The image format should be **png** or **tiff**


### 2. Segment and track cells using TissueAnalyzer

**Tissue Analyzer** (copyright Aigouy 2016) ships with its own licence
(see license_TA.txt bundled in the software). Tissue Analyzer should not be modified or
reverse engineered.  Tissue Analyzer should always be distributed
bundled with **TissueMiner** and not alone.

You can install the latest version of Tissue Analyzer (formerly known
as Packing Analyzer) within FIJI (http://fiji.sc/Fiji). To do so:

* launch FIJI
* open the "Help" menu
* click on "Update..."
* click on "Manage update sites"
* click on "Add" and enter "http://sites.imagej.net/TA/" in the URL field (and anything you like in the "Name" field)
* click "Close" and FIJI should offer you to install TA.

Once the installation is complete, restart FIJI, open the "Plugins" menu and click on "Tissue Analyzer"

For a quick start guide, click [here](https://github.com/mpicbg-scicomp/tissue_miner/blob/master/docs/TAdoc.pdf)


### 3. Optionally, define regions of interest (ROI's) and orient the tissue along the x or y axis
To this purpose, we provide two [FIJI](http://fiji.sc/) programs ***draw_n_get_ROIcoord.ijm*** and ***orient_tissue.ijm***.

#### 3.1 Define ROI's:
* launch FIJI
* go to the ***fiji_macros*** folder located in your TissueMiner installation folder
* drap-and-drop the ***draw_n_get_ROIcoord.ijm*** file into FIJI
* a script editor opens automatically
* click **RUN** and define your ROI's   

By default, TissueMiner always creates two ROI's: 

* "raw": corresponds to all segmented and tracked cells
* "whole_tissue": corresponds to cell lineages that remain in the field of view



#### 3.2 Orient the tissue
* launch FIJI
* go to the ***fiji_macros*** folder located in your TissueMiner installation folder
* drap-and-drop the ***orient_tissue.ijm*** file into FIJI
* a script editor opens automatically
* click **RUN** and define the tissue axis to be aligned on x or y. 

Both programs automatically save a text file (LastFrameRoi.txt and transformation.txt, respectively). If these files are present, TissueMiner will take them into account for further precessing steps.


### 4. Open a terminal

* You'll find it either in your application menu or application folder (depending on your system):

![alt tag](../../readme_screenshots/docker_toolbox_osx_quickstart_icon_nolabel.png)


### 5. Go to the movie directory

* Browse your data to find the **movie folder**
* **In your terminal** type in ***cd*** and a **space**
* and drag-and-drop the **movie folder** into the terminal

Summary:
`cd <path_to_movie_folder>`

* Set up the docker command and store it in a shell variable for simplicity


`DOCKER="docker run --rm -ti -v $(dirname $PWD):/movies -w /movies/$(basename $PWD) etournay/tissue_miner"`

### 6. Select the analysis you are interested in
Here, we propose some streamlined quickstart tutorials.
{'fraction_non_alphanumeric': 0.09973404255319149, 'fraction_numerical': 0.005319148936170213, 'mean_word_length': 4.461873638344227, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6635931', 'n_tokens_mistral': 2314, 'n_tokens_neox': 2161, 'n_words': 985}