> For the complete documentation index, see [llms.txt](https://stitchit.swcmicroscopy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stitchit.swcmicroscopy.com/new-users/samplesplitter.md).

# sampleSplitter walkthrough

`stitchit.sampleSplitter` is a GUI tool that should be run after each acquisition. If a single sample was imaged, this tool can be used to crop out areas that do not contain any tissue. If multiple samples were imaged, this tool will allow the samples to be split up into separate directories.

### Usage

* In a MATLAB session `cd` to your sample directory on the data analysis PC
* Run the command `stitchit.sampleSplitter` and the following GUI will appear.

![sample\_splitter](https://326914071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl1mUe85omq3F87GCTSYT%2Fuploads%2Fgit-blob-ce458fdc5bca10f0dd8fc54f6b7f8253bc4b95a3%2Fsample_splitter.png?alt=media)

* Press "Add ROI". Draw a box around your sample. You can re-size the image window to make it bigger. Double-click on the ROI to accept it.
* If you have more than one sample, you should name each ROI in the final column of the GUI table according to the sample name. This is so the directories and files produced are named correctly and not called "ROI 1", "ROI 2", etc. If you have one sample, you can leave the name as is.
* You can optionally rotate brains by 90 degree increments using the "Rot" column in the GUI. Enter -1, 1, or 2 to rotate.
* Once you are happy press "Apply ROIs". The process begins and there are updates on the command line window. Once complete a directory containing the original, uncropped images, is created. This can later be deleted.
