Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nicolasbrossard
Copy link
Contributor

@nicolasbrossard nicolasbrossard commented Jan 29, 2025

First draft for the PR that adds the MRI variables in the imaging_browser's query engine. All vars are added, except those associated to the predefined comments. The information used to set the variable values sometimes differs from those used in CouchDB_MRI_Importer but I put comments in the code for those cases.

Fixes #9374 (partially)

@nicolasbrossard nicolasbrossard added State: Needs work PR awaiting additional work by the author to proceed Priority: High PR or issue should be prioritised over others for review and testing Needs formatting PR requires formatting fixes to meet our coding standards (PHPCS, phan, etc.) labels Jan 29, 2025
@cmadjar
Copy link
Collaborator

cmadjar commented Feb 3, 2025

@nicolasbrossard could you fix the formatting and the tests from this PR?

@nicolasbrossard
Copy link
Contributor Author

@cmadjar @driusan I fixed the linter/phan issues so this PR is ready for review/testing. I am saving the implementation of the predefined comments for later. Please advise what should be the ETA for these.


$this->addTable('LEFT JOIN session s ON (s.CandID=c.CandID)');
$this->addTable("LEFT JOIN files ON (s.ID=files.SessionID)");
/* @phan-suppress-next-line PhanUndeclaredMethod */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't suppress phan errors.

If you're getting "UndeclaredMethod" errors it's likely because you moved the call outside of the instanceof check that ensured it was declared.

Copy link
Collaborator

@CamilleBeau CamilleBeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be working well except for the "Selected file for " columns. All files for the visit show up in all of these, even the ones that are not selected and not from the indicated scan type
Screen Shot 2025-02-12 at 12 46 39 PM
Screen Shot 2025-02-12 at 12 47 22 PM

@driusan driusan added this to the 27.0.0 milestone Feb 17, 2025
@nicolasbrossard nicolasbrossard force-pushed the mri_vars_query_engine branch 2 times, most recently from 558fecb to 8cfc8c0 Compare February 19, 2025 23:41
@nicolasbrossard
Copy link
Contributor Author

@CamilleBeau Bug fixed. Ready to be tested again.

'TotalRejected' => [
'StringType',
'processing:total_rejected',
'regexp_replace(pf.value, "\\(.*", "")',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still this regexp_replace!

Copy link
Collaborator

@CamilleBeau CamilleBeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Passed manual tests

@CamilleBeau CamilleBeau added the Passed manual tests PR has been successfully tested by at least one peer label Feb 24, 2025
\"$this->baseURL\",
\"/api/v0.0.3/candidates/\",
c.CandID,
c.ID,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API URL should still be using CandID. The ID is only for internal joins.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

$ScanType . "_Selected",
"Selected file for $ScanType for session",
$scope,
new \LORIS\Data\Types\Enumeration("true", "false"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this to be an enumeration of true/false instead of a BooleanType?

@nicolasbrossard nicolasbrossard changed the title First draft for the PR that adds the MRI variables in the imaging_browser's query engine Add the MRI variables in the imaging_browser's query engine Mar 14, 2025
@nicolasbrossard nicolasbrossard removed the State: Needs work PR awaiting additional work by the author to proceed label Mar 17, 2025
@nicolasbrossard nicolasbrossard force-pushed the mri_vars_query_engine branch from d5f3fab to ae3e64c Compare June 3, 2025 19:51
@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Module: imaging_browser PR or issue related to imaging_browser module labels Jun 3, 2025
@nicolasbrossard nicolasbrossard changed the base branch from main to 27.0-release June 4, 2025 12:49
@github-actions github-actions bot added Language: SQL PR or issue that update SQL code Module: statistics PR or issue related to statistics module Module: issue_tracker PR or issue related to issue tracker module labels Jun 4, 2025
@github-actions github-actions bot added Module: timepoint_list PR or issue related to the timepoint_list module Module: user_accounts PR or issue related to the user_accounts module Module: dicom_archive PR or issue related to dicom_archive module Module: data_release PR or issue related to data_release module Module: dataquery PR or issue related to (new) dataquery module labels Jun 4, 2025
@nicolasbrossard nicolasbrossard changed the base branch from 27.0-release to main June 4, 2025 12:57
@nicolasbrossard nicolasbrossard changed the base branch from main to 27.0-release June 4, 2025 12:58
driusan and others added 16 commits June 4, 2025 09:08
This puts the infrastructure in place to translate strings in loris on
the PHP side using the gettext library. Japanese is added as an example
(mostly using machine translation which could probably use proof reading
by a native speaker.)

Each module has its own textdomain for strings that come from that
module, as well as a "loris" textdomain for general LORIS terms (menu
categories, common terms, etc). The translations for a module are in
$MODULEDIR/locale and the loris textdomain is in $LORISROOT/locale.

The module names, menu categories, and breadcrumb text are currently
marked up as translateable strings. This is enough to ensure that the
menus and breadcrumbs in LORIS get translated.
![Screenshot of LORIS with menus
translated](https://github.com/user-attachments/assets/5bd0849b-b826-465d-b281-b2ab1dd78f37)

A new LORIS middleware detects the preferred language by looking for:
1. A lang=? passed in the query parameter (this can be used for testing,
but does not currently have any way in the GUI to select)
2. The User's preference under "my_preferences"
3. The HTTP request's Accept-Language header

in that order and ensuring that it's a language supported by the project
by looking for the language_code in the LORIS "language" table.

The pot files at the root of the locale directories are translation
templates to give to translators. The
locale/$lang/LC_MESSAGES/$textdomain.po contain the translation mapping.
The .mo files are the compiled version used by the software and can be
generated by "make locales". (We may want to rethink the structure of
the Makefile in the future to have `make $modulename` do both the locale
and javascript compilation.)

Projects may override strings by putting the (compiled) gettext .mo file
in the $project/locale/ directory (which would also be a good place to
store the .po files). These are generated with `msgfmt -o filename.mo
inputfile.po` (msgfmt is included with gettext.)

Note that the format of the locale directories must be:
locale/$lang/LC_MESSAGES/$textdomain.mo. We do not have any control over
that. (Other then the name of the first "locale" directory, but that
seems pretty standard.)

It's also worth noting that, from what I've read, the *server* must have
the locale installed for gettext to support the translation, not just
LORIS. I don't know why. It seems silly.
@nicolasbrossard nicolasbrossard force-pushed the mri_vars_query_engine branch from 7f5e06b to d521c0a Compare June 4, 2025 14:08
driusan pushed a commit that referenced this pull request Jun 4, 2025
This adds the MRI variables in the imaging_browser's query
engine. The information used to set the variable values sometimes
differs from those used in `CouchDB_MRI_Importer` but I put comments in
the code for those cases.

(This is a re-issue of PR #9545 on branch `27.0-release`)

Fixes #9374
@driusan
Copy link
Collaborator

driusan commented Jun 17, 2025

Was replaced by #9824

@driusan driusan closed this Jun 17, 2025
SKADE2303 pushed a commit to SKADE2303/Loris that referenced this pull request Jul 10, 2025
This adds the MRI variables in the imaging_browser's query
engine. The information used to set the variable values sometimes
differs from those used in `CouchDB_MRI_Importer` but I put comments in
the code for those cases.

(This is a re-issue of PR aces#9545 on branch `27.0-release`)

Fixes aces#9374
jeffersoncasimir pushed a commit to jeffersoncasimir/Loris that referenced this pull request Aug 11, 2025
This adds the MRI variables in the imaging_browser's query
engine. The information used to set the variable values sometimes
differs from those used in `CouchDB_MRI_Importer` but I put comments in
the code for those cases.

(This is a re-issue of PR aces#9545 on branch `27.0-release`)

Fixes aces#9374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code Language: SQL PR or issue that update SQL code Module: acknowledgements PR or issue related to acknowledgements module Module: api_docs PR or issue related to api_docs module Module: api PR or issue related to api module Module: battery_manager PR or issue related to battery_manager module Module: behavioural_qc PR or issue related behavioural_qc module Module: brainbrowser PR or issue related to brainbrowser module Module: bvl_feedback PR or issue related to bvl_feedback module Module: candidate_list PR or issue related to candidate_list module Module: candidate_parameters PR or issue related to candidate_parameters module Module: candidate_profile PR or issue related to candidate_profile module Module: configuration PR or issue related to configuration module Module: conflict_resolver PR or issue related to conflict_resolver module Module: create_timepoint PR or issue related to create_timepoint module Module: dashboard PR or issue related to dashboard module Module: data_release PR or issue related to data_release module Module: datadict PR or issue related to (old) datadict module Module: dataquery PR or issue related to (new) dataquery module Module: dicom_archive PR or issue related to dicom_archive module Module: dictionary PR or issue related to (new) dictionary module Module: document_repository PR or issue related to documen_repository module Module: dqt PR or issue related to (old) dqt module Module: electrophysiology_browser PR or issue related to electrophysiology_browser module Module: electrophysiology_uploader PR or issue related to electrophysiology_uploader Module: examiner PR or issue related to examiner module Module: genomic_browser PR or issue related to genomic_browser module Module: help_editor PR or issue related to help_editor module Module: imaging_browser PR or issue related to imaging_browser module Module: imaging_qc PR or issue related to imaging_qc module Module: imaging_uploader PR or issue related to imaging_uploader module Module: instrument_builder PR or issue related to instrument_builder module Module: instrument_list PR or issue related to instrument_list module Module: instrument_manager PR or issue related to instrument_manager module Module: instruments PR or issue related to instruments module Module: issue_tracker PR or issue related to issue tracker module Module: login PR or issue related to login module Module: media PR or issue related to media module Module: module_manager PR or issue related to module_manager module Module: mri_violations PR or issue related to mri_violations module Module: my_preferences PR or issue related to my_preferences module Module: new_profile PR or issue related to new_profile module Module: next_stage PR or issue related to next_stage module Module: oidc PR or issue related to the oidc (OpenID Connect) module Module: publication PR or issue related to the publication module Module: schedule_module PR or issue related to the schedule_manager module Module: server_processes_manager PR or issue related to the server_processes_manger Module: statistics PR or issue related to statistics module Module: survey_accounts PR or issue related to the survey_accounts module Module: timepoint_list PR or issue related to the timepoint_list module Module: user_accounts PR or issue related to the user_accounts module Needs formatting PR requires formatting fixes to meet our coding standards (PHPCS, phan, etc.) Passed manual tests PR has been successfully tested by at least one peer Priority: High PR or issue should be prioritised over others for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dataquery] dataquery module should include all data from CouchDB_Import_MRI

4 participants