Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imaging Browser: Added SNR for some imaging modalities (Redmine 1622) #1993

Merged
merged 9 commits into from
Jul 28, 2016
1 change: 1 addition & 0 deletions SQL/Archive/16.1/2016-07-12-SNRParameterType.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO parameter_type (Name, Type, SourceFrom) VALUES ('SNR', 'double', 'parameter_file');
44 changes: 42 additions & 2 deletions modules/imaging_browser/js/ImagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,28 @@ ImageQCDropdown = React.createClass({
);
}
});
ImageQCStatic = React.createClass({
displayName: 'ImageQCStatic',

render: function () {
var staticInfo;
staticInfo = React.createElement(
'div',
{ className: 'col-xs-12' },
this.props.defaultValue
);
return React.createElement(
'div',
{ className: 'row' },
React.createElement(
'label',
null,
this.props.Label
),
staticInfo
);
}
});

ImagePanelQCStatusSelector = React.createClass({
displayName: 'ImagePanelQCStatusSelector',
Expand Down Expand Up @@ -400,6 +422,18 @@ ImagePanelQCCaveatSelector = React.createClass({
});
}
});
ImagePanelQCSNRValue = React.createClass({
displayName: 'ImagePanelQCSNRValue',

render: function () {
return React.createElement(ImageQCStatic, {
Label: 'SNR',
FormName: 'snr',
FileID: this.props.FileID,
defaultValue: this.props.SNR
});
}
});
ImagePanelQCPanel = React.createClass({
displayName: 'ImagePanelQCPanel',

Expand All @@ -424,6 +458,10 @@ ImagePanelQCPanel = React.createClass({
FileID: this.props.FileID,
HasQCPerm: this.props.HasQCPerm,
Caveat: this.props.Caveat
}),
React.createElement(ImagePanelQCSNRValue, {
FileID: this.props.FileID,
SNR: this.props.SNR
})
);
}
Expand Down Expand Up @@ -581,7 +619,8 @@ ImagePanelBody = React.createClass({
QCStatus: this.props.QCStatus,
Caveat: this.props.Caveat,
SelectedOptions: this.props.SelectedOptions,
Selected: this.props.Selected
Selected: this.props.Selected,
SNR: this.props.SNR
})
)
),
Expand Down Expand Up @@ -650,6 +689,7 @@ ImagePanel = React.createClass({
Caveat: this.props.Caveat,
SelectedOptions: this.props.SelectedOptions,
Selected: this.props.Selected,
SNR: this.props.SNR,

Fullname: this.props.Fullname,
XMLProtocol: this.props.XMLProtocol,
Expand All @@ -661,4 +701,4 @@ ImagePanel = React.createClass({
);
}
});
RImagePanel = React.createFactory(ImagePanel);
RImagePanel = React.createFactory(ImagePanel);
35 changes: 34 additions & 1 deletion modules/imaging_browser/jsx/ImagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@ ImageQCDropdown = React.createClass({
);
}
});
ImageQCStatic = React.createClass({
render: function() {
var staticInfo;
staticInfo = (
<div className="col-xs-12">
{this.props.defaultValue}
</div>
);
return (
<div className="row">
<label>{this.props.Label}</label>
{staticInfo}
</div>
);
}
});

ImagePanelQCStatusSelector = React.createClass({
render: function() {
Expand Down Expand Up @@ -209,6 +225,18 @@ ImagePanelQCCaveatSelector = React.createClass({
);
}
});
ImagePanelQCSNRValue = React.createClass({
render: function () {
return (
<ImageQCStatic
Label="SNR"
FormName="snr"
FileID={this.props.FileID}
defaultValue={this.props.SNR}
/>
);
}
});
ImagePanelQCPanel = React.createClass({
mixins: [React.addons.PureRenderMixin],
render: function() {
Expand All @@ -231,7 +259,10 @@ ImagePanelQCPanel = React.createClass({
HasQCPerm={this.props.HasQCPerm}
Caveat={this.props.Caveat}
/>

<ImagePanelQCSNRValue
FileID={this.props.FileID}
SNR={this.props.SNR}
/>
</div>
);
}
Expand Down Expand Up @@ -363,6 +394,7 @@ ImagePanelBody = React.createClass({
Caveat={this.props.Caveat}
SelectedOptions={this.props.SelectedOptions}
Selected={this.props.Selected}
SNR={this.props.SNR}
/>
</div>
</div>
Expand Down Expand Up @@ -428,6 +460,7 @@ ImagePanel = React.createClass({
Caveat={this.props.Caveat}
SelectedOptions={this.props.SelectedOptions}
Selected={this.props.Selected}
SNR={this.props.SNR}

Fullname={this.props.Fullname}
XMLProtocol={this.props.XMLProtocol}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class NDB_Form_Imaging_Browser extends NDB_Form
'QCStatus' => $FileObj->getParameter('QCStatus'),
'QCDate' => $FileObj->getParameter('QCLastChangeTime'),
'Caveat' => $FileObj->getParameter('Caveat'),
'SNR' => $FileObj->getParameter('SNR'),
'SeriesUID' => $FileObj->getParameter('SeriesUID'),
'XMLreport' => $FileObj->getParameter('processing:DTIPrepXmlReport'),
'XMLprotocol' => $FileObj->getParameter('ProtocolFile'),
Expand Down
1 change: 1 addition & 0 deletions modules/imaging_browser/templates/form_viewSession.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"SelectedOptions" : {$selected_options|json_encode},

"Caveat" : "{if $files[file].Caveat}{$files[file].Caveat}{/if}",
"SNR" : "{if $files[file].SNR}{$files[file].SNR}{/if}",
'HeaderInfo' : {
'XStep' : "{$files[file].Xstep}",
'YStep' : "{$files[file].Ystep}",
Expand Down