Getting water in the pre-clinic

So there are two rooms for me to start drilling in. The first in the “Pre-clin”. It has the handpiece connections for me to practice along with the attachments for the manikin/typodont. The other location is the “Sim-clin” which not only has the handpiece and manikin attachments, but it also has running water.

Now, running water is a huge game changer when it comes to working on a composite preparation. Unfortunately, I very rarely have access to the Sim-clin, so I am left with only the pre-clin. Therefore, I decided to experiment to see if I can somehow get running water in the pre-clin.

So the first idea was to somehow get water into the handpiece itself.

However, this is not easy since the bottom attachment doesn’t have any room for me to inject water.

Instead, I was inspired to use a water pump to squirt water into the manikin/typodont’s mouth.

I was able to get one from Petco (which is normally used for fish tanks) and then I hooked it up to a tube (using materials from Home Depot). I then put it all into a bucket of water.

When I turned the pump on, I got running water!

However, I needed the water to be “squired” out like a super-soaker, not a faucet. So I used a clamp to decrease the diameter of the tube at the output end.

I then simply pointed the tube at the tooth that I am working on. Yes, this does mean that the water is always running, even if the handpiece is not running. Also, this means I may have to use my other hand to redirect the water which can be very annoying; especially if I am doing indirect vision for a tooth preparation.

Thankfully, the typodont already has a drainage hole, so I simply connected another tube to it…

and then had it drain to another bucket.

For the most part, this “works”. Here are some of the benefits of doing this:

  • As I am drilling, all the debris does get washed out
  • The visual effect that water has on the tooth is very similar to what is happening in the sim-clin; meaning I will get the same kind of refraction and translucency that throw me off when I work with water

There are lots of obvious issues right now (and I am open to suggestions to fix them):

  • Since the water tube is completely separate from the hand piece, I would have to use another hand in order to direct it. As mentioned eairler, I can’t do this well if I am working on maxillary teeth. I tried to mount the tube on top of the hand piece, but that actually blocked my view of the tooth so much that it was completely useless.
  • There is no way to stop it without either using clamps or simply unplugging the machine. It would be nice to make a button of some kind that would allow me to stop the water when I don’t need it.

I’ll post any updates if I solve any issues.

Posted in Denistry | Tagged , , , , | Leave a comment

Dance Dance MeeGo Revolution

I keep forgetting to mention this in my blog, but when I was working at ICS, one of my side projects was to make a QML based clone of Dance Dance Revolution / Stepmania.

Also, here is a Youtube video of my quick demo:

Posted in Computer Graphics, Computer Programs | Tagged , , , | Leave a comment

QML Hormone data

I decided to some studying of the endocrine system and decided I need to re-memorize the different hormones once again. I can’t use KWordQuiz since I have to remember two different attributes for each hormone, so I am going to have to make my own kind of flash cards. Here is the GPLed work that I have so far:


import QtQuick 1.0

Item {
    property alias hormoneModel: hModel
    ListModel {
        id: hModel

        ListElement {
            name: "Follicle-stimulating (FSH)"
            source: "Anterior pituitary"
            action: "Females: stimulates maturation of Graafian follicles in ovary. Males: spermatogenesis"
        }

        ListElement {
            name: "Luteinizing (LH)"
            source: "Anterior pituitary"
            action: "In female: ovulation. In male: stimulates Leydig cell production of testosterone"
        }

        ListElement {
            name: "Adrenocorticotropic (ACTH)"
            source: "Anterior pituitary"
            action: "Synthesis of corticosteroids (glucocorticoids and androgens) in adrenocortical cells"
        }

        ListElement {
            name: "Thyroid-stimulating (TSH)"
            source: "Anterior pituitary"
            action: "Stimulates the thyroid to secrete thyroxine (T4) and triiodothyronine (T3)"
        }

        ListElement {
            name: "Prolactin"
            source: "Anterior pituitary"
            action: "Milk production in mammary glands; sexual gratification after sexual acts"
        }

        ListElement {
            name: "Endorphins"
            source: "Anterior pituitary"
            action: "Inhibit the perception of pain in the brain"
        }

        ListElement {
            name: "Growth hormone"
            source: "Anterior pituitary"
            action: "Stimulates growth and cell reproduction"
        }

        ListElement {
            name: "Oxytocin"
            source: "Hypothalamus; stored in posterior pituitary"
            action: "Stimulates uterine conteractions during labor; release breast milk"
        }

        ListElement {
            name: "Vasopressin (ADH)"
            source: "Hypothalamus; stored in posterior pituitary"
            action: "Retention of water in kidneys"
        }

        ListElement {
            name: "Thyroid hormones (T4, T3)"
            source: "Thyroid"
            action: "Increase the basal metabolic rate; sensitivity to catecholamines, affect protein synthesis"
        }

        ListElement {
            name: "Calcitonin"
            source: "Thyroid"
            action: "Construct bone; reduce blood Ca2+"
        }

        ListElement {
            name: "Parathyroid hormone"
            source: "Parathyroid"
            action: "increase blood Ca2+; indirectly stimulate osteoclasts"
        }

        ListElement {
            name: "Glucocorticoid"
            source: "Adrenal cortex"
            action: "Stimulation of gluconeogenesis; Inhibition of glucose uptake in muscle and adipose tissue; Stimulation of fat breakdown in adipose tissue"
        }

        ListElement {
            name: "Mineralocorticoids"
            source: "Adrenal cortex"
            action: "Acts on the kidneys to provide active reabsorption of sodium and an associated passive reabsorption of water"
        }

        ListElement {
            name: "Epinephrine"
            source: "Adrenal medulla"
            action: "Fight-or-flight response; Boosts the supply of oxygen and glucose to the brain and muscles"
        }

        ListElement {
            name: "Norepinephrine"
            source: "Adrenal medulla"
            action: "Fight-or-flight response; Boosts the supply of oxygen and glucose to the brain and muscles"
        }

        ListElement {
            name: "Glucagon"
            source: "Pancreas"
            action: "Increases blood glucose level"
        }

        ListElement {
            name: "Insulin"
            source: "Pancreas"
            action: "Intake of glucose, glycogenesis and glycolysis in liver and muscle from blood"
        }

        ListElement {
            name: "Somatostatin"
            source: "Pancreas"
            action: "Inhibit release of GH, insulin and glucagon; Lowers rate of gastric emptying"
        }

        ListElement {
            name: "Testosterone"
            source: "Testes"
            action: "Growth of muscle mass and strength, increased bone density, growth and strength"
        }

        ListElement {
            name: "Estrogen"
            source: "Ovary"
            action: "promote formation of female secondary sex characteristics; accelerate metabolism; reduce muscle mass; increase fat stores"
        }

        ListElement {
            name: "Progesterone"
            source: "Ovary"
            action: "Support pregnancy; Raise epidermal growth"
        }

        ListElement {
            name: "Melatonin"
            source: "Pineal"
            action: "Antioxidant and causes drowsiness"
        }

        ListElement {
            name: "Atrial-natriuretic peptide"
            source: "Heart muscle cells"
            action: "Reduction in blood volume and therefore a reduction in cardiac output and systemic blood pressure"
        }

        ListElement {
            name: "Thymosins"
            source: "Thymus"
            action: "Enhance cell-mediated immunity and lymphocte development"
        }
    }
}

As for how the quiz will look like, it will probably be something like:

Yeah, it will be a listview of listviews

Yeah, it will be a listview of listviews

Posted in Computer Programs | Tagged , , , , , | Leave a comment

Making Amino Acid FlashCards Plasmoid

I was wondering how hard it was to make a KDE Plasmoid for my Amino Acid Flash Card app; but it turns out to be fairly easy. All I really had to do was point a .desktop file to the qml file and install it via plasmapkg. Here is a screen shot of it with two of them in action:

The desktop file was fairly simple: it pretty much looks like this:

[Desktop Entry]
Name=AAMobile Quiz
Comment=A Quiz for Learning the different amino acids
Icon=chronometer
 
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-DefaultSize=360,360
 
X-KDE-PluginInfo-Author=Tej Ashok Shah
X-KDE-PluginInfo-Email=myFullName@gmail.com
X-KDE-PluginInfo-Website=http://tshah.wordpress.com
X-KDE-PluginInfo-Category=Education
X-KDE-PluginInfo-Name=org.kde.aamobilequiz
X-KDE-PluginInfo-Version=0.1
 
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-ServiceTypes=Plasma/Applet
Type=Service

Posted in Computer Programs | Tagged , , , , , , , | Leave a comment

After 4 hours of coding

This is what I have:

Initial version of Mobile Amino Acid Project

Initial version of Mobile Amino Acid Project

Posted in Computer Graphics, Computer Programs | Tagged , , , | Leave a comment

Using QML to read KWordQuiz files

It turns out that reading KWordQuiz files via QML’s XmlListModel is actually fairly easy. Here is a quick proof of concept I was able to make:

import QtQuick 1.0

Rectangle {
    width: 360
    height: 360

    XmlListModel {
        id: kvtmlModel
        source: "/home/kata/Amino-Acid-Tutorial-Project/aa.kvtml"
        query: "/kvtml/entries/entry"

        XmlRole {
            name: "aaName"
            query: "translation/text/string()"
        }
        XmlRole {
            name: "aaImage"
            query: "translation/image/string()"
        }
    }

    ListView {
        anchors.fill: parent
        model: kvtmlModel
        delegate: rowComp
        spacing: 20
    }

    Component {
        id: rowComp
        Row {
            Text {
                text: aaName
            }
            Image {
                id: theImg
                source: "/home/kata/Amino-Acid-Tutorial-Project/" + aaImage
            }
        }
    }

}

You can find the images and the kvtml files over here. I think with this proof of concept, I can work on the mobile version that will read the kvtml files and I can quiz myself on a mobile phone.

Posted in Computer Programs | Tagged , , , , | Leave a comment

Amino Acid Quiz Project

I just started a project at github for some of the work I have been doing on memorizing the Amino Acid structures.

Screen shot of KWordQuiz using the amino acid kvtml file

Screen shot of KWordQuiz using the amino acid kvtml file

A lot more work needs to be done (like being able to use more than just flash cards to quiz myself); but if I put enough effort into it, I can make something useful for everybody.

Posted in Computer Programs | Tagged , , | Leave a comment

tejPresent with a new UI

I thought the old UI of tejPresent looked too confusing; so I decided to update the UI. The new style is almost done; I just have to put in a few more bug-fixes before I can make a real release (people can check out the SVN and try it out for now).  Here is an example pic of how it looks like now:

 

Posted in Uncategorized | Leave a comment

New tejPresent website

I made a quick website for tejPresent. Be sure to check it out.

Posted in Uncategorized | Leave a comment

Website I am working on

I am currently working on Dr. Ashok Shah’s website. It is a basic static site. However, it is using the latest features of HTML5 and CSS3. Here is a screenshot of the site:

Posted in Uncategorized | Leave a comment

Presenting: tejPresent

I have been working on a presentation application called “tejPresent”. It is a non-linear presentation tool that facilitates an interactive presentation with the audience. You can see the page I made for it at sourceforge. Here are some screenshots:

Posted in Computer Graphics, Computer Programs | Leave a comment

Rage screenshot zoom

Recently, id Software released a few very high resolution screenshots from their upcoming game “Rage”. I wrote the following code in Qt

#include <QtCore/QCoreApplication>
#include <QtGui>

class HelloWorldTask : public QRunnable
 {

 void run()
 {
 QImage cropped = mBigImg->copy(mI,mI,mBigImg->width() - (mI *2), mBigImg->height() - (mI * 2));
 QImage scaled = cropped.scaled(1920,1080, Qt::IgnoreAspectRatio , Qt::SmoothTransformation );
 QString zeros = "";
 if(mI<10)
 zeros = "000";
 else if(mI<100)
 zeros = "00";
 else if (mI<1000)
 zeros = "0";
 QString filename = "/media/disk/tshah/blenderstuff/bigVi/" + zeros + QString::number(mI) + ".png";
 qDebug()<< "Writing to " << filename;
 scaled.save(filename,"PNG",100);
 }

 public:
 HelloWorldTask(QImage *bigImg, int i);
 QImage *mBigImg;
 int mI;
 };

HelloWorldTask::HelloWorldTask(QImage *bigImg, int i)
{
 mBigImg = bigImg;
 mI = i;
}

int main(int argc, char *argv[])
{
 QCoreApplication a(argc, argv);

 QImage *bigImg = new QImage("/media/disk/tshah/Pictures/wasteland.tif");
 //QThreadPool::globalInstance()->setMaxThreadCount(1);

 for(int i=7000 ; i < 10000 ; i++)
 {
 HelloWorldTask *hello = new HelloWorldTask(bigImg,i);
 QThreadPool::globalInstance()->start(hello);

 }
 return a.exec();
}

I realize now there is bug in that it doesn’t keep the aspect ratio; but it is a little too late now. Well, here is a video of it anyway:

Posted in Uncategorized | Leave a comment

More blender testing

Here is yet another test using Blender. I am right now going back to the basics and re-learning everything about blender.

Posted in Computer Graphics | Leave a comment

Electrophilic Aromatic Substitution Trainer

As I was studying for the next quiz in Organic Chem, I decided to make a trainer.

Electrophilic Aromatic Substitution Trainer Screen

Electrophilic Aromatic Substitution Trainer Screen

I decided to make this one free for everybody to download and use. Please contact me if you find any bugs. Keep looking at this post to see if there are any updates.

Update 1: I found a minor bug about the “-halogen”. I can’t fix the Mac version for now…

Downloads:
Linux Version (source code)
Mac Version (has “-halogen” bug)
Windows Version

Posted in Computer Programs | Tagged , , | Leave a comment

Organic Chemistry IUPAC Priority Group Order

Taking Organic Chemistry, I need to memorize many random items. One of them is the priority group order when determining the IUPAC name. So I wrote a script that would help me memorize the order.

#!/usr/bin/python
#(C) 2009 Tej A. Shah
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.
import random
random.seed()

groups = ['carboxylic acids','sulfonic acids', 'esters', 'amides', 'nitriles', 'aldehydes', 'ketones', 'alcohols', 'thiols', 'amines', 'alkenes', 'benzene', 'alkynes', 'none']

ans = '>'
correct = False
while ans != '':
	a = 1
	b = 1
	while a == b:
		a = random.randint(0,len(groups) -1)
		b = random.randint(0,len(groups) -1)
	correct = False
	while correct == False:
		ans = raw_input(groups[a] + " vs. " + groups[b] + "   ")	
		if ans == '>' :
			if a < b : #correct
				print "Correct"
				correct = True
			else :
				print "Wrong"
		elif ans == '<' :
			if a > b: #correct
				print "Correct"
				correct = True
			else :
				print "Wrong"
		else :
			correct = True
			ans = ''
print "Done"

Posted in Computer Programs | Tagged , , | 1 Comment

Python script for resizing images and putting “black border”

As you may have noticed in my flashing images video, I had to get all the images the same size in order to use ffmpeg to convert them into a video. However, since not all the images were the same size, I had to write a script that would put the black borders. So I used Python’s PIL to thumbnail the image and then save with a black border as a png file for ffmpeg to use. Here is the script that I used:

#!/usr/bin/python
#(C) 2009 Tej A. Shah
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import Image
import ImageDraw
from os.path import join, getsize

size = 1920,1080
counter = 0
names = []

for root, dirs, files in os.walk('wedding photos'):
	for name in files:
		names = names + [os.path.join(root,name)]

names.sort()
        
for name in names:
	print name
	newImg = Image.new("RGB",size)
	draw = ImageDraw.Draw(newImg)
	draw.rectangle((0,0,size),(0,0,0))
	del draw
                
	oldImg = Image.open(name)
	oldImg.thumbnail( size, Image.ANTIALIAS )
	oldImg = oldImg.convert("RGB")

	xStartPoint = (size[0] /2) - (oldImg.size[0]/2)
	newImg.paste(oldImg, (xStartPoint,0,xStartPoint + oldImg.size[0], size[1]) )

	counter = counter +1
	if counter < 10:
		filename = "000" + str(counter)
	elif counter < 100 :
		filename = "00" + str(counter)                
	elif counter < 1000 :
		filename = "0" + str(counter)                
	else:
		filename = str(counter)
	newImg.save("makeMovie/" + filename + ".png","PNG")

Posted in Computer Graphics, Computer Programs | Tagged , , | Leave a comment

N810 Shuffle script

I can’t fit all of my music to my N810, so I decided to write a script that would randomly fill up my N810 with random music until it ran out of space.

#    (C) 2009 Tej A. Shah
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import shutil
import random

from os.path import join

shutil.rmtree('/media/N810/Music/')
os.mkdir('/media/N810/Music/')
fileList = []

for root, dirs, files in os.walk('~/Music/'):
	for name in files:
		fileList.append(os.path.join(root,name))

random.shuffle(fileList)
for f in fileList:
	print f
	shutil.copy(f,'/media/N810/Music/')

Posted in Computer Programs | Tagged , , | Leave a comment

DAT Angle Trainer

So I am right now studying for the DATs. One part that I am having trouble with is the figure out the angle sizes. So I made a trainer using Qt toolkit. If people are interested in adding more features, I can post it to Sourceforge.

DAT Angle Trainer

DAT Angle Trainer

Posted in Computer Programs | Tagged , , , | Leave a comment

Cosplay to anime algorithms

I was recently at Anime Boston and took many photos. One of the things I was wondering was how to convert some of these photos from “real” to anime. For example, here is one pic that I took

Cosplayer- Rinoa

And the “perfect” program would convert it to

Rinoa

Which I know is impossible. However, that will not prevent me from trying something. Using the normal GIMP tutorials for making a “pencil sketch”, I made a few trials (which all turned out badly).

Neliel Cosplay OriginalNeliel Pencil style

Ah My Goddess Cosplayers (Original)Ah My Goddess Pencil style

However, I did some experimenting to see what other styles I could use and here are some of my results:

Using GIMP oil and overlay style

Using GIMP oil and overlay style

Oil outline style

Oil outline style

Using the tiles and outlines, I made a picture that looks like a 2 year old made it

Using the tiles and outlines, I made a picture that looks like a 2 year old made it

Please let me know what your techniques are ;-)

Posted in Computer Graphics | Tagged , , | Leave a comment

Now for some cool graphs

As I mentioned before, I am still working on which language + API to use for the Photo Viewer/Browser application I am thinking about. For this project, there will be a lot of image loading and manipulation being used. Therefore, I just wanted to do a performance test on each of the language + APIs I am thinking about. Here are the “contenders”:

Java + Swing. I mainly use the ImageIO class to load up the images and the Swing graphics library to do whatever manipulation I need.

wxPython, which is just a Python wrapper for WxWidgets, does have a good number of built-in image manipulation functions that I can use.

Qt (using C++) has a ton of functions that I can use. The only thing that is driving me away from Qt is the fact that it is C++ and putting features like sftp may end up being harder with C++.

So here is the simple test: load up many images that are 2560 x 1920 and resize them as fast as you can. I decided to separate the tests out in hopes of getting a better picture of what is going on.

 

Results of Testing

Results of Testing

 

 

 Just so we can get this straight, the blue bar is just loading up the image and not doing anything. The orange bar means for each image, resize it to a 320×240 rectangle using linear interpolation. And then the yellow bar is the same as the orange except with bi-linear interpolation. The results are interesting since it first seems like wxPython is very fast compared to Java, but then falls flat into the ground as soon as it does bi-linear filtering. Meanwhile, Java gives about half of the image performance compared to Qt with C++. Do note that this is using the Java6 for Mac OS X so there might be some better performance with the Linux version since it has OpenGL hardware acceleration (but I don’t know if that will help it too much). 

PS: If anybody wants to see the source code or do some similar tests, just leave a comment and I will just post the source.

 

EDIT (July 7th):

Thanks for all the comments. Here are a few responses:

1. Please note that at the end of the day, I have to actually display those images. I don’t want to use PIL because then I would have to convert it again to the wxWidget’s image format in order to display it. PIL could be faster in the resizing of the image, but I doubt it will be faster in the image loading. Perhaps I should do Python + Qt?

2. I use both a mac and linux, so Cocoa or Core Graphics will not work all the time and I really don’t like the idea of using .NET on a Mac.

Posted in Computer Graphics, Computer Programs | Tagged , , , | 3 Comments