Projects

Stereotactic Robot Interface

November 2020 - August 2021

In this project, I developed a GUI to work with a stereotactic robot. This interface was aimed to be used by physicians to find the stereotactic coordinates for surgeries from more than 200 brain atlases. Since there were so many brain atlases and so many brain parts in each one of them, they needed the ability to search a brain part and see only the atlases that contained that brain part. Also, since there were many large brain parts that were available in more than 50 brain atlases, the physicians needed to know in which atlases the desired brain part is larger. I had access to a PDF of these atlases; I converted them to SVG files and tried to find each brain part and size of them from the SVG files, but it was not possible since the SVG files were auto-generated and several paths were responsible for forming a brain part. Finding the brain parts with image processing was also difficult since many brain parts had a dashed line border, making it hard to detect as a contour. I preprocessed SVG files to change every dashed line to a solid line and delete any unnecessary information in order to find brain part contours with OpenCV.

Info
Brain atlases used in this project were extracted from Paxinos & Watson’s The Rat Brain: In Stereotaxic Coordinates published by Elsevier. Unfortunately, I’m not allowed to share an example of these atlases; contact me if you have a question.

I also created another version of SVG files containing only brain parts abbreviation. I used the coordinates of the brain part contours in these SVG files to find the name of each brain part. To increase accuracy, I matched the recognized brain part abbreviation to the text extracted from the PDF file. If there were no match, the algorithm would choose the closest brain part abbreviation available.

Hough transform was used to find the frame of each brain atlas in order to calculate the stereotactic coordinates.


Genetic Algorithm for Ackley Function

March 2020 - May 2020

Available on GitHub: https://github.com/SMMousaviSP/genetic_ackley

In this program, you can test the efficiency of the genetic algorithm on Ackley function.

You can choose the binary chromosome size, the population in each generation, crossover method, parent selection method, survival selection method, probability of selecting a chromosome for mutation, and probability of changing a gene for mutation.

Supported Crossover Methods:

  • n point
  • single point
  • uniform

Supported Parent Selection Methods:

  • Roulette Wheel Selection (RWS)
  • Stochastic Universal Sampling (SUS)
  • Tournament Selection (TS)

Supported Survival Selection Methods:

  • Roulette Wheel Selection (RWS)
  • Stochastic Universal Sampling (SUS)
  • Tournament Selection (TS)
  • Elitism
Figure 1 - Average fitness in each iteration

Figure 1 - Average fitness in each iteration

After choosing all of the parameters, the program will show you the best-found answer (the binary chromosome, fitness, x, y, and the output of Ackley function), the best answer in the last iteration, maximum fitness in different iterations plot, and average fitness in different iterations plot.


Reversi Game

June 2018

Available on GitHub: https://github.com/SMMousaviSP/reversi_game

I developed this game in 2018 for the Advanced Programming course final project after studying Java and OOP for only a few months and working with Android Studio for less than a month. Please keep that in mind if you want to read the source code. There might be problems or better ways to write some parts.

How to Install

You can clone this repository and build the APK file for yourself. You can build this project for Android 8.1 or later, it might even work for Android 6 or 7, but it hasn’t been tested.

An easier way to install and play the game would be downloading the APK file from releases on GitHub.

How to Play

If you don’t know Persian, here is a quick guide for playing the game. But if you want to learn how to play Reversi or you want to know more about this game, you can read about it on Wikipedia.

Figure 2 - Reversi game screenshots

Figure 2 - Reversi game screenshots

In the first screenshot, from the top, the first button is start, the second button is about us, which doesn’t do anything, and the third button is exit which will close the game.

In the second screenshot, you should choose the game mode, and only one game mode is available. Choose the button which looks like two people handshaking.

In the third screenshot, you should enter the players' names; you can also see the color of their pieces.

In the fourth screenshot, you can play :D. You can see your move options with little green circles. You can also see who’s turn is at the top and the current score at the bottom.

In the fifth screenshot, someone has won by the rules of the Reversi game. The right button will restart the game with the same players, and the left button will take you to the third screenshot, where you should enter players' names.