Read the annotations on a CT image - image

I have a CT image but some of the annotations i am not sure what do they stand for. These annotations are the following:
1) PP: HFS;
2) PRE
3) TI: 821.00 msec;
4) SP: -1372.30
5) 00564489, is this a patient ID?
Anybody can help me about this? Image can also be read [here]

1) PP: HFS : This is Patient Position: Head First, Supine
2) PRE: This could mean Previous study
3) TI : 821.00 msec - Could be Time Interval
4) SP: -1372.30 - This is Slice Position
5) 00564489, is this a patient ID? -- if this is next to patient name on right top corner.
Your best option is to get the user guide or help documentation of the application you are investigating. It should list what each label represents.

Related

Tableau - Filter Dimension on Max Value of Measure

I'm trying to calculate the MAX value of column D of value E which resets for every A Column. Later I just need to show the MAX row of A.
Raw data looks like this:
The desired view would be like this:
Thanks!
This is an excellent example of a question which can/should be answered using LOD Calculations.
To start, find the maximum [Percentage] (Column E) per [Name] (Column B):
{Fixed [Name]: MAX(Percentage)}
Then insert that calculation, call it "Max Per Name", into another calculation which will only show the [Letter] (Column D) if the [Percentage] and the [Max Per Name] match:
IF [Percentage] = [Max Per Name] THEN [Letter] END
The result will be a dimension which shows the [Letter] which matches the largest [Percentage] and 'Null' when not matched.
From here, just filter out 'Null' - the result will be exactly as you desire. You will even be able to take [Percentage] off the view and still see an accurate [Letter].
Please note that while LOD Calculations are extremely powerful, they require a little more work to maintain and operate. They are a little more complex than normal calculations. Please take some time and read through this LOD Overview document to further familiarize yourself with their use/limitations.

Accessing cells with offset reference in Numbers with Applescript

How can I reference a cell relative to another cell in Applescript like in Excel VBA?
In Excel VBA I could use "offset" to set the value of cell D2:
Range("A1").Offset(1,3).Value = "Example"
I searched everywhere but there doesn't seem to be an "offset"-command in Numbers Applescript, despite it's so super handy.
Any help is much appreciated!
To complement the excellent answer by David...
If you have a need to mimic the VBA expression, the example code from David's answer can be rolled into a handler, as in the example below.
on setCellOffsetValue(cl, co, ro, val)
tell application "Numbers"
tell table 1 of sheet 1 of document 1
set c to cell cl's column's address as number
set r to cell cl's row's address as number
set value of cell (c + co) of row (r + ro) to val
end tell
end tell
end setCellOffsetValue
Now you can use it multiple times in the same script by calling it, e.g.:
setCellOffsetValue("A1", 3, 1, "Example")
As you can see in this version, the setCellOffsetValue handler takes four parameters:
cl - The cell to offset from.
co - The column offset from the cell.
ro - The row offset from the cell).
val - The value of the offset cell.
Place the setCellOffsetValue handler within your script and call it as needed.
The handler above has table, sheet, and document hardcoded, each to 1. However, in this example you also pass that information to the handler:
on setCellOffsetValue(cl, co, ro, val, t, s, d)
tell application "Numbers"
tell table t of sheet s of document d
set c to cell cl's column's address as number
set r to cell cl's row's address as number
set value of cell (c + co) of row (r + ro) to val
end tell
end tell
end setCellOffsetValue
Now you can use it multiple times in the same script by calling it, e.g.:
setCellOffsetValue("A1", 3, 1, "Example", 1, 1, 1)
Or:
setCellOffsetValue("A1", 3, 1, "Example", "Table 1", "Sheet 1", "Untitled")
The last three parameters can be either their numeric value or name value, as appropriate for the need at that moment.
This version will be handy for documents that have multiple tables and or sheets and the need to target other then table 1 of sheet 1 of document 1.
As you can see in this version, the setCellOffsetValue handler takes seven parameters:
cl - The cell to offset from.
co - The column offset from the cell.
ro - The row offset from the cell).
val - The value of the offset cell.
t - The table number or name.
s - The sheet number or name.
d - The document number or name.
Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also Working with Errors.
Edit: Thanks to user3439894 for pointing out the problems with my first answer - it was totally wrong, based on Excel instead of Numbers.
Here's a full script example, showing one method to achieve the objective in Numbers:
tell application "Numbers"
tell table 1 of sheet 1 of document 1
set c to cell "A1"'s column's address as number
set r to cell "A1"'s row's address as number
set value of cell (c + 3) of row (r + 1) to "Example"
end tell
end tell
You could condense the set command into one line, like this:
tell application "Numbers"
tell table 1 of sheet 1 of document 1
set value of cell ((cell "A1"'s column's address as number) + 3) of row ((cell "A1"'s row's address as number) + 1) to "Example"
end tell
end tell

How can I locate items using xpath from below elements?

I've created some xpath expressions to locate the first item by it's "index" after "h4". However, I did something wrong that is why it doesn't work at all. I expect someone to take a look into it and give me a workaround.
I tried with:
//div[#id="schoolDetail"][1]/text() --For the Name
//div[#id="schoolDetail"]//br[0]/text() --For the PO Box
Elements within which items I would like the expression to locate is pasted below:
<div id="schoolDetail" style=""><h4>School Detail: Click here to go back to list</h4> GOLD DUST FLYING SERVICE, INC.<br>PO Box 75<br><br>TALLADEGA AL 36260<br> <br>Airport: TALLADEGA MUNICIPAL (ASN)<br>Manager: JEAN WAGNON<br>Phone: 2563620895<br>Email: golddustflyingse#bellsouth.net<br>Web: <br><br>View in AOPA Airports (Opens in new tab) <br><br></div>
By the way, the resulting values should be:
GOLD DUST FLYING SERVICE, INC.
PO Box 75
Try to locate required text nodes by appropriate index:
//div[#id="schoolDetail"]/text()[1] // For "GOLD DUST FLYING SERVICE, INC."
//div[#id="schoolDetail"]/text()[2] // For "PO Box 75"
Locator to get both elements:
//*[#id='schoolDetail']/text()[position()<3]
Explanation:
[x] - xPath could sort values using predicate in square brackets.
x - could be integer, in this case it will automatically be compared with element's position in this way [position()=x]:
//div[2] - searches for 2nd div, similar to div[position()=2]
In case predicate [x] is not an integer - it will be automatically converted to boolean value and will return only elements, where result of x is true, for example:
div[position() <= 4] - search for first four div elements, as 4 <= 4, but on the 5th and above element position will be more than 4
Important: please check following locators on this page:
https://www.w3schools.com/tags/ref_httpmessages.asp
//table//tr[1] - will return every 1st row in each table ! (12 found
elements, same as tables on the page)
(//table//tr)[1] - will return 1st row in the first found table (1 found element)

IF statement with current time Function in Xpath

I have a Text box Infopath that displays the current time using this function:
(substring-after(now(), "T")
I also have a Drop-Down list called "Location" that has the following values:
1.Boston
2.India
3.London
I want to modify this function to set the current time to always display the current time in Boston whether the user is from India or London.
I believe that inputting an If Statement that follows these conditions:
If Location (Drop down list) = "London" - Then use (substring-after(now(), "T") subtracted by 5 hours.
If Location (Drop down list) = "India" - Then use (substring-after(now(), "T") subtracted by 11 hours.
If Location (Drop down list) = "Boston" - Then use (substring-after(now(), "T").
I'm relatively new to Xpath and require assistance.
The easiest way is to subtract the hours before ripping the time off the end with substring.
substring-after(addSeconds(now(), -3600 * 5), "T")
WARNING: Remember the current time (now()) is calculated from the LOCAL machine. So if a person in London opens the form they will already be at London time and then your code will subtract 5 hours on top of that - making it incorrect.

Trouble with insert if logic

I'm having a little of trouble getting my head around this - maybe because its late in the day!
For the beginning of this I am doing it simply so here is what I have:
A user has 4 Attributes amended to their profile (or you can think of it as a database):
Age
Budget
Gender
Transport
First condition is:
If one of these four attributes is not empty then I show an image. I have done this one like this:
If not empty age Then IMG or If not empty Budget then IMG
And so on.
I just need some guidance on:
How to show an IMG if any 2,3 or 4 of the four are not empty
Can't seem to get my head around the logic. I think I can do it but it would end up quite a large expression.
thanks!
Instead of
if (age not empty) then
IMG
else if (budget not empty) then
IMG
...
I suggest you write it as
if (!(age empty && budget empty && gender empty && transport empty)) then
IMG

Resources