Monday 7/29

Operations on lists and selected parts are working. The only oddity is that the lists can't yet access parts - only full structures - unless they're operated on by the mouse. If you remove and add something with the mouse, it's then in the list. I'd like to have all the parts automatically added to the list, if possible.

The trouble is that finding out all the parts that are descendants of a structure requires getting multiple return values from a Skandha call. As it is, if_termserv can't do that. Could I modify it, or do it separately with a cgi file, or try to deal without finding it out?

Same kind of problem with finding out about bad add commands. I think the error message may be coming back in a part of the return value that if_termserv doesn't see. This may not be true- I may be able to get at it somehow. It will require some digging to find out.

I'm presenting this on Wednesday, so it needs to be as clean and functional as possible by then.

To do:
  1. Try to put all the parts on the highlight/remove lists automatically.
  2. Try to prevent bad add commands.
  3. Save image.


Tuesday 7/30

I tried using a CGI script to find all the parts. While the script itself seemed to work without any problems, it screwed up the server somehow.

But I found another solution, by basically hacking into the if_termserv return messages. I could use the (send TreeRoot :show) command to get a message consisting of a big list of parts. Those could all go into the StructureList, or there could be another button (probably replacing the cancel button) to "Show Parts" of a particular structure. Since there are a ton of parts, option b is much more reasonable. I could also do without this bit, and try to keep the lists for just the structures and the mouse for the parts. I have to figure out what makes the most sense.

Using that solution, I did find a way to prevent bad add commands. I left the parts list alone for now. I want to ask what people would prefer.

I also added a sort-of 'save image' capability- it just loads the jpeg in another browser window, where you can easily save it to your computer. That seems reasonable to me. As for saving the scene (or loading), I want to ask what people would prefer for that, too.

To do:
  1. Plan presentation.
  2. Put up a non-Swing version to show (but keep the current one, too).
  3. Make the parts list, option b.


Wednesday 7/31

The parts list and non-Swing version are working, somewhat. One problem is that the parts list doesn't know when to stop if a structure was added using an alias ("spine" instead of "vertebral column"). Also, there are still correspondence issues between the mouse and the lists.

From the presentation, I have some choices, once the details are wrapped up: To do:
  1. Fix correspondence and bugs with mouse and lists, and clean up code.


Thursday 8/1

Cleaned up the code in the non-swing version, but ran into problems with the parts list. Here are some decisions, which I'll stick with unless they make the program run slowly: Problems:
- structures won't always have parts
- structure name might not show up in part list (spine)

To do:
  1. Keep fixing parts lists.


Friday 8/2

I've got just about everything working with the parts, I think. The main problem was getting the part list in a reliable, correct way. Here are some ways I explored (using 'aorta'):

-KB-GET-DESCENDANTS
("Wall of aorta" "Lumen of aorta" "Ascending aorta" ("Ascending aorta proper" "Supravalvular ridge of aorta" "Bulb of aorta" ("Aortic sinus" "Anterior aortic sinus" ("Ostium of right coronary artery" "Ostium of third coronary artery (right)" "Absent ostium of right coronary artery") "Left posterior aortic sinus" ("Ostium of left coronary artery" "Ostium of third coronary artery (left)" "Absent ostium of left coronary artery") "Right posterior aortic sinus") "Wall of ascending aorta" "Lumen of ascending aorta") "Arch of aorta" ("Wall of arch of aorta" "Lumen of arch of aorta" "Ascending trunk of arch of aorta" ("Commencement of arch of aorta") "Summit of arch of aorta" ("Lateral border of arch of aorta (viewed radiologically)") "Descending trunk of arch of aorta" ("Preductal region of aortic arch" ("Aortic isthmus") "Juxtaductal region of aortic arch" "Postductal region of aortic arch" ("Aortic spindle"))) "Descending aorta" ("Descending thoracic aorta" ("Wall of descending thoracic aorta" "Lumen of descending thoracic aorta") "Abdominal aorta" ("Suprarenal aorta" "Infrarenal aorta" "Terminal aorta" "Bifurcation of aorta")))

-- includes parts without models

-KB-GET-CHILDREN
("Wall of aorta" "Lumen of aorta" "Ascending aorta" "Arch of aorta" "Descending aorta")

-- missing further descendants with models

-TREEROOT:SHOW
"abdominal aorta","descending thoracic aorta","descending aorta","descending trunk of arch of aorta","summit of arch of aorta","ascending trunk of arch of aorta","arch of aorta","ascending aorta"

-- requires checking for when to stop

-XSKS-GET-NAMES-TREEROOT
("ascending aorta" "ascending trunk of arch of aorta" "summit of arch of aorta" "descending trunk of arch of aorta" "descending thoracic aorta" "abdominal aorta")

-- leaves out a few, for some reason (arch of aorta, descending aorta)
-- requires checking for when to stop

I ended up finding the function (kb-get-master-term) to solve the checking problem with the TREEROOT:SHOW option, and then using (kb-get-ancestors) to add a part to an existing part list. I had to telnet to 'tela 2322' to find the functions.

To do:
  1. Test everything.
  2. Briefly check out save/load scene.
  3. Update the Swing version.
  4. Try DSG with new FM thing.
  5. Ask about updating to new FM- is graphics server itself outdated?


Sunday 8/4

The server isn't working again today, so I could only do 2 and 3. I'm going to ask Jim about that if it becomes a problem ever again, because I'm really not sure Andrew understood at all what the problem was.

The DSG saves to VRML like this:
----
local($result);
$result=&Send_To_Skandha("(xsks-save-vrml-file $root_structure \"results/$root_structure.wrl\")");
----

It saves a scene like this (no str file, though- only anat and jpeg files?):
----
local($result);
local(%db_list);
local($destination) = "$SG_CONF{scenes_dir}/$curr_scene";
local($scene_label) = $curr_scene;
$scene_label =~ s/ /_/g;
unlink "$SG_CONF{scenes_dir}/$curr_scene.str";
$result=&Send_To_Skandha( "(gs-save-state \"../scenesdir/" . $curr_scene . "\")" );
copy("$SG_CONF{state_dir}/${anat_name}","$SG_CONF{state_dir}/${anat_name}.anat");
copy($SG_CONF{results_dir} . "/arbitrary$OldPID.jpeg","$SG_CONF{scenes_dir}/$scene_label.jpeg");
----

It loads a scene like this (except I don't think it works):
----
local($result);
local(%db_list);
local($destination) = "$SG_CONF{scenes_dir}/$curr_scene";
local(@anatomy);
local(%anathash);
if ($curr_scene ne "") {
$result=&Send_To_Skandha( "(gs-load-state \"../scenesdir/" . $curr_scene . "\")" );
}
if (-e $destination . ".anat") {
copy( $destination . ".anat", "$SG_CONF{state_dir}/${anat_name}" );
}
if( $result eq "NIL") {
print ("\n