//8-29-17 added object type conversion var markerSize = call("ij.Prefs.get","marker.Size",0); var markerMultiplier = call("ij.Prefs.get","marker.Multiplier",0); var fontSize = call("ij.Prefs.get","font.Size",0); var markerChoice=call("ij.Prefs.get","marker.channelMustBeActive",true); var lockChannelChoice=call("ij.Prefs.get","marker.lockChannelChoice",true); if (markerSize == 0) { showMessage("Run ObjectJ or check your version first because there is something fishy going on here"); }else{ Dialog.create("ObjectJ Preferences"); Dialog.addString("Set the default size of markers here (16): ", markerSize); Dialog.addString("Set the default font size of marker labels (16): ",fontSize); Dialog.addString("This number adjusts how much larger a selected marker becomes (1.5): ", markerMultiplier); Dialog.addCheckbox("Hide markers when the channel they are on is off", markerChoice) Dialog.addCheckbox("Keep same channels on or off when using prev or next object buttons", lockChannelChoice) Dialog.addMessage("Set the output marker name code pairs below. If you don't see anything, make sure your project is initialized from the action bar."); ojAdvance();//just in case no item is selected activeName=ojActiveItemName(); colCheck=ojColumnNumber(activeName+"_xpos"); if (colCheck>0){ //get markers from column names since no direct function exists markers = newArray(ojNColumns()); index=0; for (i=1;i<=ojNColumns();i++){ if(endsWith(ojGetColumnTitle(i),"xpos")){ markers[index]=substring(ojGetColumnTitle(i), 0, indexOf(ojGetColumnTitle(i), "_"));//find the name before the _ index++; } } markers=Array.trim(markers,index); //get existing list from prefs or generate a new default one if it doesn't exist var markerNameCodes=call("ij.Prefs.get","marker.nameCode",""); if (markerNameCodes==""){ for(i=0;i0) call("ij.Prefs.set","marker.nameCode",List.getList); call("ij.Prefs.savePreferences"); ojUpdateMarkers(true); if (ojImageLink()>0){ currentImage=ojImageLink(); getLocationAndSize(x, y, width, height); Stack.getPosition(channel, slice, frame); flag=getBoolean("Do you want to close the current ObjectJ Image and try to show any changes you made to display settings? You may have to close and reopen the project if this doesn't work. "); if ( flag){ close(); ojShowImage(currentImage); setLocation(x, y); Stack.setPosition(channel, slice, frame); } } }