I'm a newbie to Ruby and using ActiveRecord.
I'm trying to create a record (i.e. a new instance of a class) using ActiveRecord. I've already created and ran the migration, which created this file:
class CreatePeople < ActiveRecord::Migration
def change
create_table :people do |t|
t.string :first_name
t.string :last_name
t.datetime :birthdate
end
end
end
This is my model file with a class called Person in it:
class Person < ActiveRecord::Base
end
I went to the terminal and started the IRB console with the command "rake console." I tried the inputs: person = Person.new and person = Person.create(first_name: "Dave", last_name: "Smith"). Either input just gives me this error message:
ActiveRecord::StatementInvalid: PG::InternalError: ERROR: expected "]" to end datum,
but got "0 0 0 0 ]}) :location 2634}}
ETA (full error message):
ActiveRecord::StatementInvalid: PG::InternalError: ERROR: expected "]" to end datum,
but got "0 0 0 0 ]}) :location 2634}} :targetList ({TARGETENTRY :expr {VAR
:varno 4 :varattno 1 :vartype 19 :vartypmod -1 :varcollid 0 :varlevelsup 0
:varnoold 4 :varoattno 1 :location 2224} :resno 1 :resname schemaname
:ressortgroupref 0:resorigtbl 2615 :resorigcol 1: resjunk false}
{TARGETENTRY :expr {VAR :varno 3 :varattno 1 :vartype 19 :vartypmod -1
:varcollid 0 :varlevelsup 0 :varnoold 3: varattno 1 :location 2257} :resno 2
:resname tablename :ressortgroupref 0 :resorigtbl 1259 :resorigcol 1
:resjunk false} {TARGETENTRY :expr {FUNCEXPR :funcid 1645 :funcresulttype 19
:funcretset false :funcvariadic false :funcformat 0: funccollid 0
:inputcollid 0 :args ({VAR :varno 3: varattno 5 :vartype 26 :vartypmod -1
:varcollid 0 :varlevelsup 0 :varnoold 3 : varoattno 5 :location 2305})
:location 2289} :resno 3 :resname tableowner :ressortgroupref 0 :resorigtble
0 :resorigcol 0 :resjunk false} {TARGETENTRY :expr {VAR :varno 6 :varattno 1
:vartype 19 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 6 : varattno
1 :location 2340} :resno 4 :resname tablespace :ressortgroupref 0
:resorigtble 1213 :resorigcol 1 :resjunk false} {TARGETENTRY :expr {VAR
:varno 3 :varttno 13 :vartype 16 :vartypmod -1 :varcollid 0 :varlevelsup 0
:varnoold 3 :varoattno 13 :location 2373} :resno 5 :resname hasindexes
:ressortgroupref 0 :resorigtble 1259 :resorigcol 13 :resjunk false}
{TARGETENTRY :expr {VAR :varno 3 :varattno 21 :vartype 16 :vartypmod -1
:varcollid 0 :varlevelsup 0 :varnoold 3 :varoattno 21 :location 2410} :resno
6 :resname hasrules :ressortgroupref 0 :resorigtble 1259 :resorigcol 21
:resjunk false} {TARGETENTRY :expr {VAR :varno 3 :varattno 22 :vartype 16
:vartypmod -1 :varcollid 0 :varlevels up 0 :varnoold 3 :varoattno 22
:location 2445} :resno 7 :resnmae hastriggers :ressortgroupref 0 :resorigtbl
1259 :resorigcol 22 :resjunk false}} :withCheckOptions <> :returningList <>
:groupClause <> :havingQual <> :windowCaluse <> :distinctClause <>
:sortClause <> :limitOffset <> :limitCount <> :rowMarks <> :setOperations <>
:constraintDeps <>})”; length = 1
LINE 2: FROM pg_tables
: SELECT TABLENAME
FROM pg_tables
WHERE schemaname = ANY (current_schemas(false))
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/postgresql/database_statements.rb:147:in ‘async_exec’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/postgresql/database_statements.rb:147:in ‘block in query’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/abstract_adapter.rb:473: in ‘block in log’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.2.1/lib
/active_support/notifications/instrumenter.rb:20:in ‘instrument’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/abstract_adapter.rb:467:in ‘log’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/postgresql/database_statements.rb:146:in ‘query’
From C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/postgresql/schema_statements.rb:91:in ‘tables’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/schema_cache.rb:90:in ‘prepare_tables’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/schema_cache.rb:22:in ‘table_exists?’
From C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/model_schema.rb:230:in ‘table_exists?’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/attribute_methods/primary_key.rb:97: in ‘get_primary_key’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/attribute_methods/primary_key.rb:95:in ‘reset_primary_key’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/connection_adapters/postgresql/
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/attribute_methods/primary_key.rb:73:in ‘primary_key’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/model_schema.rb:234:in ‘attributes_builder’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/model_schema.rb:254: in ‘_default_attributes’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/core.rb:273:in ‘initialize’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/inheritance.rb:61:in ‘new’
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.1/lib/active_record
/inheritance.rb:61:in ‘new’
As noted by m_x, there was an issue with the PG setup. There was no issue with ActiveRecord itself. In order to resolve this specific StatementInvalid Error, a full uninstall and reinstall needed to be performed for PostgreSQL.
It seemed like PostgreSQL's data folder got corrupted in some way. Just uninstalling using the Control Panel or the PostgreSQL uninstaller did not uninstall PostgreSQL completely. Specifically, PostgreSQL was not being uninstalled from the registry. This partial uninstall prevented a new data folder for PostgreSQL from being created with the correct bin and lib directories within it. These steps needed to be followed to get PostgreSQL to be uninstalled completely:
Uninstall PostgreSQL from control panel or the PostgreSQL
uninstaller from within the PostgreSQL directory.
Delete PostgreSQL directory folder
Run CCleaner to make sure old PostgreSQL registry keys are deleted. (free download available here: http://www.filehippo.com/download_ccleaner)
Download and reinstall PostgreSQL
Related
I am trying to get the daykey from dates which i need to use in Array to fill "0" if data is not available .
My dates start from "2022-02-08" and end with "2022-03-10".
Trying to get daykey using code
$rahul = Buffalomilkrecord::select(DB::raw('date'), DB::raw('sum(totalmilk) as totalmilk, DATE_FORMAT(date,"%d") as "daykey"'))
->whereBetween('date', [$olddate, $todaydate] )
->groupBy(DB::raw('date'))
->orderBy('date','asc')
->get();
the out put i am getting
array:31 [▼
0 => "2022-03-01"
1 => 0
2 => 0
3 => 0
4 => 0
5 => 0
6 => 0
7 => "2022-02-08"
8 => 0
9 => 0
10 => 0
11 => 0
12 => 0
13 => 0
14 => 0
15 => "2022-02-16"
16 => "2022-02-17"
17 => "2022-02-18"
18 => "2022-02-19"
19 => "2022-02-20"
20 => "2022-02-21"
21 => "2022-02-22"
22 => "2022-02-23"
23 => 0
24 => "2022-02-25"
25 => "2022-02-26"
26 => 0
27 => 0
28 => 0
29 => 0
30 => 0
]
$ddtest = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
foreach($rahul as $order)
{
$ddtest[$order->daykey-1] = $order->date;
}
Here i am expecting to start array with
0 => "2022-02-08" and so on.... as date start in Month and end with March
I feel i am doing some error in query but can not find where i am doing mistake..
Thanks in advance for help
The SQL will only return exiting data, so if there is no data for this specific day, you wont get a row for this day. This is something you have to take care outside of the query.
You need to build the date range by yourself. for example like this:
I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?
Build one array with "default" entries per day with 0 values and than merge them with the sql result.
How do i query to make total count per day based on a name or an id?
id
name
1
Facebook
2
Twitter
3
Reddit
id
page_id
social_id
visited_at
1
1
1
2021-03-27
2
1
1
2021-03-27
3
1
2
2021-03-27
4
1
2
2021-03-27
5
1
3
2021-03-27
6
1
3
2021-03-27
7
1
1
2021-03-28
8
1
1
2021-03-28
9
1
2
2021-03-28
10
1
2
2021-03-28
11
1
3
2021-03-28
12
1
3
2021-03-28
With the following query i get count of click on all social anchors per day, but i want to show in the chart also which social anchor has been clicked on that day.
$social_stats= Social::join('social_statistics', 'social_statistics.social_id','socials.id')
->select( array(
'social_statistics.visited_at as visited_at',
DB::raw('count(*) as count'),
)
)
->orderBy('visited_at')
->groupBy('visited_at')
->pluck('count','visited_at')
->all();
Need to render a Chart that shows by day the count of click on different social.
$social_bar_chart = new SocialBarChart;
$visited_at = collect(array_keys($this->social_bar));
$social_bar_labels = $visited_at->map(function ($date) {
return Carbon::parse($date)->format('d/m');
})->toArray();
$social_bar_chart->labels($social_bar_labels)
->dataset('Social Count', 'bar', array_values($this->social_bar))
->options([
'tooltip' =>['show' => true],
'backgroundColor' => '#54a0ff',
]);
I have a .txt file that contain my schedule of playlist for my tv channel. In the file there are many characters as 'logo_0 2' in. I run a ruby command to process the playlist (.txt file). How i want to delete these all 'logo_0 2' in the ruby ? Attached herewith is the .txt file and the rb file to execute the process. I need to eliminate the 'logo_0 2' in .txt file.
ITEM
preset_date 04/08/16
preset_time 22:09:00:00
title Awani (Comedy) Obviously Harith Iskander Sat Ep11 : Logo Inti College + Air Asia + Radio (E) Aug06 Sat 9.30pm
clip HUZKN01HM01AS
in_src 928500
out_src 929250
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148671633
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:09:30:00
title RiaHD (Series) Lelaki Macam Dia : Generic (Bm) Isnin - Khamis # 2200
clip HUJST01HM01DV
in_src 1018125
out_src 1018875
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148669553
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:10:00:00
title Citra Mustika (Movie Compact) August Highlights (Bm)
clip HUXAP01HM01CM
in_src 962500
out_src 963250
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148671344
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:10:30:00
title Awani (News) Awani 7.45 (Bm) Setiap Hari # 1945
clip HULHP01HM01AE
in_src 909000
out_src 909750
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148671634
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:11:00:00
title Episode Number 880
clip TAPE_REPLACEMENT
in_src 0
out_src 12000
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 1
notes Isu utama harian dan mingguan dikupas dengan mendalam oleh ahli panel.
user_data 05_P_174282654
logo_data_0 0
channel_id 2
end
ITEM
preset_date 04/08/16
preset_time 22:19:00:00
title Awani (News) Buletin Awani Noon (Bm) Setiap Hari # 1200
clip HUUIL01HM01AI
in_src 915000
out_src 915750
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148671635
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:19:30:00
title Sports Rio Olympics 2016 - Opening Ceremony (BM) Live Aug6 6.55am
clip HUUUY01HM01AB
in_src 904000
out_src 904750
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148668511
aspect_ratio 2
channel_id 2
use_subtitle 0
end
ITEM
preset_date 04/08/16
preset_time 22:20:00:00
title Awani (Biz News) Bisnes Awani Plus (Bm) Sabtu # 1830
clip HPVAP01HM01DU
in_src 1050000
out_src 1050750
mode 1
no_vision_trans 1
no_audio_trans 1
type 1
logo_0 2
user_data 05_I_148671638
aspect_ratio 2
channel_id 2
use_subtitle 0
end
It would be good if you share your ruby code and we can show you how to update it.
filename = 'item.txt'
contents=File.read(filename)
contents.gsub!("logo_0 2\n", '')
File.open(filename, "w") { |f| f << contents }
In case you only want to replace characters contents.gsub!("logo_0 2", '') use this statement in place of contents.gsub!("logo_0 2\n", '')
I am facing an issue in my application throwing an error
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'mid'
strLine = Trim(Mid(strLine, 1, InStr(UCase(strLine), "SINGLE POINT DATA") - 1))
Main function is below
strLine = tstextstreamRead.ReadAll
If cint(intTestId) = 23 Then
strLine2 = Trim(Mid(strLine, InStr(UCase(strLine), "SINGLE POINT DATA") + 1, Len(strLine)))
strLine2 = Trim(Mid(strLine2, InStr(strLine2, "Model Cross-Arrhenius"), Len(strLine2)))
End If
response.write strLine
strLine = Trim(Mid(strLine, 1, InStr(UCase(strLine), "SINGLE POINT DATA") - 1))
When i verified through response.write strline
below i got the data
Sample ID Region :PACIFIC
Request No :tesy
Sample No :12
Company :213
Family :213
Grade :213
Standard :ZOLLER METHOD
Color No :UNKNOWN
Lot No :UNKNOWN
Remark :213
Date :7/22/2016
Generic :123
Operator :213
Test Lab :WTC
Test Name :Pressure-Volume-Temperature (PVT)
Test Method :ZOLLER METHOD
Dataset 0
POINTS 26 30.2 1109.998 40.6 1126.961 50.8 1124.916 61.1 1121.716 71.3 1117.909 81.5 1113.674 91.4 1108.76 101.4 1103.019 111.8 1095.211 121.8 1087.404 131.8 1079.681 142.2 1072.674 152 1065.485 162.3 1057.771 172.1 1050.805 182.3 1043.491 193.4 1036.327 203 1029.239 214.1 1022.532 223.6 1015.535 234.6 1008.179 245.1 1000.297 255 993.677 265.6 986.178 275.4 979.918 285.8 973.305
Dataset 50
POINTS 26 30.2 1141.188 40.6 1145.201 50.8 1142.895 61.1 1140.183 71.3 1137.529 81.5 1134.817 91.4 1132.018 101.4 1129.33 111.8 1125.39 121.8 1120.212 131.8 1113.709 142.2 1107.681 152 1101.57 162.3 1095.298 172.1 1089.361 182.3 1083.419 193.4 1077.757 203 1072.34 214.1 1066.657 223.6 1061.414 234.6 1055.779 245.1 1049.333 255 1043.651 265.6 1038.333 275.4 1033.283 285.8 1028.57
Dataset 100
POINTS 26 30.2 1160.699 40.6 1159.695 50.8 1157.533 61.1 1155.299 71.3 1153.075 81.5 1151.028 91.4 1149.093 101.4 1147.7 111.8 1145.902 121.8 1142.99 131.8 1138.733 142.2 1133.957 152 1128.643 162.3 1123.009 172.1 1117.834 182.3 1112.526 193.4 1107.26 203 1102.65 214.1 1097.619 223.6 1093.004 234.6 1086.949 245.1 1082.376 255 1077.455 265.6 1072.812 275.4 1068.752 285.8 1064.607
Dataset 150
POINTS 26 30.2 1174.42 40.6 1172.732 50.8 1170.673 61.1 1168.593 71.3 1166.813 81.5 1165.074 91.4 1163.543 101.4 1162.673 111.8 1161.681 121.8 1160.11 131.8 1157.741 142.2 1154.905 152 1150.866 162.3 1146.22 172.1 1141.382 182.3 1136.381 193.4 1131.774 203 1127.484 214.1 1123.175 223.6 1118.773 234.6 1113.149 245.1 1108.975 255 1104.514 265.6 1100.457 275.4 1096.706 285.8 1093.423
Dataset 200
POINTS 26 30.2 1185.837 40.6 1183.95 50.8 1182.17 61.1 1180.377 71.3 1178.593 81.5 1177.103 91.4 1175.963 101.4 1175.373 111.8 1174.678 121.8 1173.552 131.8 1172.182 142.2 1170.538 152 1168.029 162.3 1164.802 172.1 1160.855 182.3 1156.361 193.4 1152.075 203 1147.987 214.1 1143.934 223.6 1139.92 234.6 1134.884 245.1 1130.755 255 1126.75 265.6 1123.348 275.4 1119.874 285.8 1116.635
Kindly let me know what is the exact problem.
Your data does not contain "SINGLE POINT DATA", so InStr() returns 0 (not found) and your Mid() call boils down to
>> s = Mid("s", 1, -1)
>>
Error Number: 5
Error Description: Invalid procedure call or argument
>>
You should check the Instr() result:
nPos = InStr(UCase(strLine), "SINGLE POINT DATA")
If 0 = nPos Then
WScript.Echo "Bingo"
Else
strLine = Trim(Mid(strLine, 1, nPos - 1))
End If
I'm new to processing DICOM images away from their native manufacturer software. I am trying to dicomread a PET image from a set of reconstructed transaxial slices into MatLab. My aim is to do some simple segmentation and finally determine the maximum and minimum pixel value in the segment. However I am having trouble with converting the stored values to their values seen on the native system.
The image is loading into MatLab as an int16 class. The maximum pixel value is always 32767, regardless of which slice I load from the series. I know from viewing the images on their native system that the maximum pixel value in each slice is different.
I've checked the rescale value and rescale intercept values and the rescale relationship appears to be linear. Is there another correction I should be making? I assume all other corrections (e.g. decay, scatter and randoms) are made during the reconstruction process.
Any help would be appreciated (hopefully I'm missing something simple!).I've posted the DICOM info retrieved from the header below (Don't worry, the images are of a phantom so there is no patient identifying data).
Regards,
Ross
Filename: [1x76 char]
FileModDate: '26-Jul-2013 10:50:42'
FileSize: 38356
Format: 'DICOM'
FormatVersion: 3
Width: 128
Height: 128
BitDepth: 16
ColorType: 'grayscale'
FileMetaInformationGroupLength: 182
FileMetaInformationVersion: [2x1 uint8]
MediaStorageSOPClassUID: '1.2.840.10008.5.1.4.1.1.128'
MediaStorageSOPInstanceUID: [1x49 char]
TransferSyntaxUID: '1.2.840.10008.1.2.1'
ImplementationClassUID: '1.2.840.113619.6.55'
SourceApplicationEntityTitle: 'dst01'
IdentifyingGroupLength: 484
SpecificCharacterSet: 'ISO_IR 100'
ImageType: 'ORIGINAL\PRIMARY'
InstanceCreationDate: '20130522'
InstanceCreationTime: '171655'
InstanceCreatorUID: '1.2.840.113619.1.131'
SOPClassUID: '1.2.840.10008.5.1.4.1.1.128'
SOPInstanceUID: [1x49 char]
StudyDate: '20130514'
SeriesDate: '20130514'
AcquisitionDate: '20130514'
ContentDate: '20130522'
StudyTime: '142911'
SeriesTime: '143208.00'
AcquisitionTime: '143208.00'
ContentTime: '171655'
AccessionNumber: ''
Modality: 'PT'
Manufacturer: 'GE MEDICAL SYSTEMS'
InstitutionName: 'NHS TRUST'
ReferringPhysicianName: [1x1 struct]
StationName: 'dst01'
StudyDescription: ''
SeriesDescription: 'WB_3D_VuePoint'
PhysicianReadingStudy: [1x1 struct]
OperatorName: [1x1 struct]
ManufacturerModelName: 'Discovery STE'
Private_0009_GroupLength: 2714
Private_0009_10xx_Creator: 'GEMS_PETD_01'
Private_0009_11xx_Creator: 'GEMS_GENIE_1'
Private_0009_1002: 'SOLID_TEST'
Private_0009_1005: '20130514143030.00'
Private_0009_1006: 0
Private_0009_100a: [1x45 char]
Private_0009_100d: '20130514143208.00'
Private_0009_100e: '20130514143055.00'
Private_0009_1013: [1x59 char]
Private_0009_1014: 'Sternal Notch'
Private_0009_1015: 'SN'
Private_0009_1016: 0
Private_0009_1017: 0
Private_0009_1018: 0
Private_0009_1019: 0
Private_0009_101a: 1
Private_0009_101b: 0
Private_0009_101c: 1
Private_0009_101d: 0
Private_0009_101e: 1
Private_0009_101f: 1
Private_0009_1020: 0
Private_0009_1021: 1
Private_0009_1022: 0
Private_0009_1023: 0
Private_0009_1024: 2
Private_0009_1025: 2
Private_0009_1026: 23
Private_0009_1027: 1
Private_0009_1028: 1
Private_0009_1029: 0
Private_0009_102a: 0
Private_0009_102b: 70
Private_0009_102c: 153
Private_0009_102d: 0
Private_0009_102e: 0
Private_0009_1034: 0
Private_0009_1035: 0
Private_0009_1036: 'FDG -- fluorodeoxyglucose'
Private_0009_1037: ''
Private_0009_1038: 0
Private_0009_1039: ''
Private_0009_103a: 0
Private_0009_103b: ''
Private_0009_103c: 0
Private_0009_103d: ''
Private_0009_103e: '18F'
Private_0009_103f: 6588
Private_0009_1040: 0.9700
Private_0009_104d: 0
Private_0009_104e: 23
Private_0009_104f: 23
Private_0009_1050: 7
Private_0009_1051: 7
Private_0009_1052: 32
Private_0009_1053: 800
Private_0009_1054: 650
Private_0009_1055: 425
Private_0009_1056: [1x49 char]
Private_0009_1057: [1x48 char]
Private_0009_1059: [1x49 char]
Private_0009_105a: 0
Private_0009_105c: [1x49 char]
Private_0009_105d: [1x45 char]
Private_0009_105e: [1x51 char]
Private_0009_105f: 'SOLID_TEST'
Private_0009_1062: [1x44 char]
Private_0009_1063: 0
Private_0009_1064: 0
Private_0009_1066: 119.5000
Private_0009_1067: -79.8540
Private_0009_1068: '20130514143123.00'
Private_0009_1069: 553
Private_0009_106a: -79.9000
Private_0009_106b: 0
Private_0009_106c: '20130514143208.00'
Private_0009_106d: 180
Private_0009_1070: 0
Private_0009_1071: 90674329
Private_0009_1072: 0
Private_0009_1073: 1
Private_0009_1074: 255
Private_0009_107c: 0
Private_0009_107d: 2
Private_0009_107e: 0
Private_0009_107f: 0
Private_0009_1080: 0
Private_0009_1081: 0
Private_0009_108b: 5
Private_0009_108c: 2
Private_0009_108d: 0.0960
Private_0009_108e: 0
Private_0009_108f: 0
Private_0009_1090: 0
Private_0009_1091: 0
Private_0009_1092: 0
Private_0009_1093: 0
Private_0009_1094: 0
Private_0009_1095: 0
Private_0009_1096: [1x49 char]
Private_0009_1097: [1x51 char]
Private_0009_1098: [1x49 char]
Private_0009_1099: ''
Private_0009_109a: 0
Private_0009_109b: 0
Private_0009_109c: ''
Private_0009_109d: 0
Private_0009_109e: 0
Private_0009_109f: 0
Private_0009_10a0: 0
Private_0009_10a1: 0
Private_0009_10a2: 0
Private_0009_10a3: 0
Private_0009_10a6: 26
Private_0009_10a7: 0
Private_0009_10ab: 0
Private_0009_10ac: 0
Private_0009_10ad: ''
Private_0009_10ae: ''
Private_0009_10b2: 2
Private_0009_10b3: 20
Private_0009_10b4: 70
Private_0009_10b5: 0
Private_0009_10b6: 0
Private_0009_10b7: 0
Private_0009_10b8: 0
Private_0009_10b9: 0
Private_0009_10ba: 1
Private_0009_10bb: 6
Private_0009_10bc: 0
Private_0009_10bd: 0
Private_0009_10be: 0
Private_0009_10bf: 0
Private_0009_10c0: 0
Private_0009_10c1: 0
Private_0009_10c2: 0
Private_0009_10c3: 0
Private_0009_10c4: 6
Private_0009_10c5: 0
Private_0009_10c6: 0
Private_0009_10c7: 0
Private_0009_10cb: 0.8601
Private_0009_10cc: 0.1256
Private_0009_10cd: 0.8240
Private_0009_10ce: -0.0254
Private_0009_10cf: 0.5000
Private_0009_10d0: -0.0483
Private_0009_10d5: 0
Private_0009_10d6: 70.5000
Private_0009_10d7: -79.9000
Private_0009_10d8: 1
Private_0009_10db: 3
Private_0009_10dc: 2
Private_0009_10df: 47
Private_0009_10e2: 10
Private_0009_10e4: '3D_AC'
Private_0009_10e5: 0
Private_0009_10e6: 0
Private_0009_10e7: 0
Private_0009_10e9: 0
Private_0009_10ea: 0
Private_0009_10eb: 0
Private_0009_10ec: 0
Private_0009_111e: [1x49 char]
Private_0009_1146: [1x49 char]
PatientGroupLength: 96
PatientName: [1x1 struct]
PatientID: 'SOLID_TEST'
PatientBirthDate: ''
PatientSex: ''
PatientAge: ''
PatientSize: 0
PatientWeight: 0
EthnicGroup: ''
AdditionalPatientHistory: ''
Private_0017_GroupLength: 46
Private_0017_10xx_Creator: 'GEMS_PETD_01'
Private_0017_1004: '20130207140047.00'
AcquisitionGroupLength: 230
SliceThickness: 3.2700
AcquisitionTerminationCondition: 'TIME'
AcquisitionStartCondition: 'MANU'
AcquisitionStartConditionData: 0
AcquisitionTerminationConditionData: 0
SoftwareVersion: '41.04'
ProtocolName: 'WB 3D'
TriggerTime: 0
FrameTime: 0
IntervalsAcquired: 0
IntervalsRejected: 0
ReconstructionDiameter: 700
GantryDetectorTilt: 0
FieldOfViewShape: 'CYLINDRICAL RING'
FieldOfViewDimensions: [2x1 double]
CollimatorType: 'NONE'
ActualFrameDuration: 180000
PatientPosition: 'HFS'
Private_0019_GroupLength: 42
Private_0019_10xx_Creator: 'GEMS_PETD_01'
Private_0019_1004: '20130207140602'
RelationshipGroupLength: 322
StudyInstanceUID: [1x51 char]
SeriesInstanceUID: [1x49 char]
StudyID: '6893'
SeriesNumber: 401
InstanceNumber: 22
ImagePositionPatient: [3x1 double]
ImageOrientationPatient: [6x1 double]
FrameOfReferenceUID: [1x59 char]
PositionReferenceIndicator: 'SN'
SliceLocation: 1.8500
ImagePresentationGroupLength: 218
SamplesPerPixel: 1
PhotometricInterpretation: 'MONOCHROME2'
Rows: 128
Columns: 128
PixelSpacing: [2x1 double]
CorrectedImage: [1x40 char]
BitsAllocated: 16
BitsStored: 16
HighBit: 15
PixelRepresentation: 1
SmallestImagePixelValue: 0
LargestImagePixelValue: 32767
RescaleIntercept: 0
RescaleSlope: 0.3555
LossyImageCompression: '00'
Unknown_0040_0000: 158
AcquisitionContextSequence: [1x1 struct]
NuclearAcquisitionGroupLength: 808
EnergyWindowRangeSequence: [1x1 struct]
RadiopharmaceuticalInformationSequence: [1x1 struct]
NumberOfSlices: 47
TypeOfDetectorMotion: 'NONE'
PatientOrientationCodeSequence: [1x1 struct]
PatientOrientationModifierCodeSequence: [1x1 struct]
PatientGantryRelationshipCodeSequence: [1x1 struct]
SeriesType: 'STATIC\IMAGE'
Units: 'BQML'
CountsSource: 'EMISSION'
RandomsCorrectionMethod: 'SING'
AttenuationCorrectionMethod: 'measured,, 0.096000 cm-1,'
DecayCorrection: 'START'
ReconstructionMethod: '3D IR'
DetectorLinesOfResponseUsed: '0'
ScatterCorrectionMethod: 'Model Based'
AxialMash: [2x1 double]
TransverseMash: 2
CoincidenceWindowWidth: 0
FrameReferenceTime: 0
PrimaryPromptsCountsAccumulated: 0
SecondaryCountsAccumulated: 0
SliceSensitivityFactor: 1
DecayFactor: 1.0095
DoseCalibrationFactor: 1139
ScatterFractionFactor: 0.3174
DeadTimeFactor: 1.1243
ImageIndex: 26
PixelDataGroupLength: 32780
I work in mammo and have no experience of PET so take what I say here with a pinch of salt.
The maximum pixel value is 32767 which is 2 to the power of 15 minus 1. Is the rescale slope not of importance?
RescaleSlope: 0.3555
Presumably this can vary for each slice and the pixel values should be multiplied by this value (intercept should be added too but this is zero).
Out of the major scanner manufacturers (Siemens, GE, Philips) I have only encountered a slice-by-slice RescaleSlope value when working with GE PET cameras. However, it is always a good idea to check RescaleSlope and RescaleIntercept. The QIBA working group on FDG-PET has a collection of recommendations and also pseudocode for SUV calculations straight from the DICOM data.