Skip to content

Commit

Permalink
Merge pull request #2566 from LaurentPV/laurent_shup_gui_update
Browse files Browse the repository at this point in the history
Laurent shup gui update
  • Loading branch information
michaelkain authored Jan 17, 2025
2 parents 779ab78 + 5c36fa8 commit b844374
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void actionPerformed(ActionEvent event) {
mainWindow.birthDateTF.setText("");
mainWindow.mSexR.setSelected(true);
mainWindow.fSexR.setSelected(false);
mainWindow.oSexR.setSelected(false);

Media media = new Media();
// when the open file from CD/DVD menu is clicked
Expand Down Expand Up @@ -165,19 +166,7 @@ else if (!firstName1.equals(""))
+ firstName1.toUpperCase();
else
patientNameFinal = lastName.toUpperCase();

String modality = null;
if (!mainWindow.noRB.isSelected()) {
if (mainWindow.mrRB.isSelected()) {
modality = "MR";
} else if (mainWindow.ctRB.isSelected()) {
modality = "CT";
} else if (mainWindow.ptRB.isSelected()) {
modality = "PT";
} else if (mainWindow.nmRB.isSelected()) {
modality = "NM";
}
}
String modality = mainWindow.modality;
boolean studyRootQuery = false;
if (mainWindow.sRB.isSelected()) {
studyRootQuery = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private void readAndCopyDicomFilesToUploadFolder(String studyInstanceUID, List<S
} else {
downloadOrCopyReport.append("Error: Download: serie "
+ (serie.getSeriesNumber() != null ? "(No. " + serie.getSeriesNumber() + ") " : "")
+ serie.getSeriesDescription() + " downloaded with not existing serie folder.\n");
+ serie.getSeriesDescription() + " downloaded without an existing serie folder.\n");
logger.error(uploadFolder.getName() + ":\n\n Download of " + fileNamesForSerie.size()
+ " DICOM files for serie " + seriesInstanceUID + ": " + serie.getSeriesDescription()
+ " has failed.\n\n");
Expand Down
173 changes: 71 additions & 102 deletions shanoir-uploader/src/main/java/org/shanoir/uploader/gui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
Expand All @@ -23,6 +24,7 @@
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFormattedTextField;
Expand Down Expand Up @@ -124,6 +126,7 @@ public class MainWindow extends JFrame {
public UtilDateModel studyDateModel;
public String birthDate = "";
public String studyDate = "";
public String modality;
JScrollPane scrollPaneUpload;

public JLabel startedDownloadsLB;
Expand Down Expand Up @@ -321,25 +324,28 @@ public void actionPerformed(ActionEvent arg0) {
gbc_queryLevelLabel.gridy = 1;
queryPanel.add(queryLevelLabel, gbc_queryLevelLabel);

JPanel queryRadioPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
queryLevelRG = new ButtonGroup();

// "Patient" Radio Button
pRB = new JRadioButton("Patient");
pRB.setSelected(true);
queryLevelRG.add(pRB);
GridBagConstraints gBC_pRB = new GridBagConstraints();
gBC_pRB.insets = new Insets(2, 5, 0, 2);
gBC_pRB.fill = GridBagConstraints.HORIZONTAL;
gBC_pRB.gridx = 1;
gBC_pRB.gridy = 1;
queryPanel.add(pRB, gBC_pRB);

sRB = new JRadioButton("Study");
queryRadioPanel.add(pRB);

// "Study" Radio Button
sRB = new JRadioButton(resourceBundle.getString("shanoir.uploader.queryLevelStudy"));
queryLevelRG.add(sRB);
GridBagConstraints gBC_sRB = new GridBagConstraints();
gBC_sRB.insets = new Insets(2, 2, 0, 2);
gBC_sRB.fill = GridBagConstraints.HORIZONTAL;
gBC_sRB.gridx = 2;
gBC_sRB.gridy = 1;
queryPanel.add(sRB, gBC_sRB);
queryRadioPanel.add(sRB);

GridBagConstraints gbc_radioPanel = new GridBagConstraints();
gbc_radioPanel.insets = new Insets(2, 0, 0, 0);
gbc_radioPanel.gridx = 1;
gbc_radioPanel.gridy = 1;
gbc_radioPanel.gridwidth = 2;
gbc_radioPanel.anchor = GridBagConstraints.WEST;
gbc_radioPanel.fill = GridBagConstraints.HORIZONTAL;
queryPanel.add(queryRadioPanel, gbc_radioPanel);

JLabel patientNameLabel = new JLabel(resourceBundle.getString("shanoir.uploader.patientNameLabel"));
patientNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
Expand Down Expand Up @@ -591,57 +597,27 @@ public void actionPerformed(ActionEvent e) {
gbc_modalityLabel.gridy = 7;
queryPanel.add(modalityLabel, gbc_modalityLabel);

modalityRG = new ButtonGroup();
mrRB = new JRadioButton("MR");
mrRB.setSelected(true);
modalityRG.add(mrRB);
GridBagConstraints gBC_mrRB = new GridBagConstraints();
gBC_mrRB.insets = new Insets(2, 5, 0, 2);
gBC_mrRB.fill = GridBagConstraints.HORIZONTAL;
gBC_mrRB.gridx = 1;
gBC_mrRB.gridy = 7;
gBC_mrRB.weightx = 1.0;
queryPanel.add(mrRB, gBC_mrRB);

ctRB = new JRadioButton("CT");
modalityRG.add(ctRB);
GridBagConstraints gBC_ctRB = new GridBagConstraints();
gBC_ctRB.insets = new Insets(2, 2, 0, 2);
gBC_ctRB.fill = GridBagConstraints.HORIZONTAL;
gBC_ctRB.gridx = 2;
gBC_ctRB.gridy = 7;
gBC_ctRB.weightx = 1.0;
queryPanel.add(ctRB, gBC_ctRB);

ptRB = new JRadioButton("PT");
modalityRG.add(ptRB);
GridBagConstraints gBC_ptRB = new GridBagConstraints();
gBC_ptRB.insets = new Insets(2, 2, 0, 2);
gBC_ptRB.fill = GridBagConstraints.HORIZONTAL;
gBC_ptRB.gridx = 3;
gBC_ptRB.gridy = 7;
gBC_ptRB.weightx = 1.0;
queryPanel.add(ptRB, gBC_ptRB);

nmRB = new JRadioButton("NM");
modalityRG.add(nmRB);
GridBagConstraints gBC_nmRB = new GridBagConstraints();
gBC_nmRB.insets = new Insets(2, 2, 0, 2);
gBC_nmRB.fill = GridBagConstraints.HORIZONTAL;
gBC_nmRB.gridx = 4;
gBC_nmRB.gridy = 7;
gBC_nmRB.weightx = 1.0;
queryPanel.add(nmRB, gBC_nmRB);

noRB = new JRadioButton("None");
modalityRG.add(noRB);
GridBagConstraints gBC_noRB = new GridBagConstraints();
gBC_noRB.insets = new Insets(2, 2, 0, 10);
gBC_noRB.fill = GridBagConstraints.HORIZONTAL;
gBC_noRB.gridx = 5;
gBC_noRB.gridy = 7;
gBC_noRB.weightx = 1.0;
queryPanel.add(noRB, gBC_noRB);
String[] modalityList = { "MR", "CT", "PT", "NM", "XA", "None" };
JComboBox<String> modalityCB = new JComboBox<String>(modalityList);
modalityCB.setSelectedIndex(0);
GridBagConstraints gBC_modality = new GridBagConstraints();
gBC_modality.anchor = GridBagConstraints.WEST;
gBC_modality.insets = new Insets(5, 5, 0, 0);
gBC_modality.gridx = 1;
gBC_modality.gridy = 7;
queryPanel.add(modalityCB, gBC_modality);

modalityCB.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// If None is selected we set back to null
if (modalityList[modalityList.length - 1].equals(modalityCB.getSelectedItem())) {
modality = null;
} else {
modality = (String) modalityCB.getSelectedItem();
}
}
});

queryButton = new JButton(resourceBundle.getString("shanoir.uploader.queryButton"), searchIcon);
GridBagConstraints gbc_queryButton = new GridBagConstraints();
Expand Down Expand Up @@ -703,10 +679,11 @@ public void actionPerformed(ActionEvent e) {
.getResource("images/copyLastNameToBirthName.16x16.png"));
birthNameCopyButton = new JButton(copyIcon);
GridBagConstraints gBCBithNameCopyButton = new GridBagConstraints();
gBCBithNameCopyButton.anchor = GridBagConstraints.EAST;
gBCBithNameCopyButton.insets = new Insets(10, 10, 10, 10);
gBCBithNameCopyButton.anchor = GridBagConstraints.WEST;
gBCBithNameCopyButton.insets = new Insets(10, 0, 10, 10);
gBCBithNameCopyButton.gridx = 3;
gBCBithNameCopyButton.gridy = 2;
gBCBithNameCopyButton.gridy = 3;
birthNameCopyButton.setToolTipText(resourceBundle.getString("shanoir.uploader.copyLastNameToBirthName"));
birthNameCopyButton.setEnabled(false);
editPanel.add(birthNameCopyButton, gBCBithNameCopyButton);

Expand Down Expand Up @@ -785,50 +762,42 @@ public void actionPerformed(ActionEvent e) {
new RSDocumentListener(this));

/**
* Radio buttons for sex: F, M or O
* Radio buttons for sex: Female, Male or Other
*/
GridBagConstraints sexGBconstraints = new GridBagConstraints();
sexGBconstraints.insets = new Insets(10, 0, 10, 10);

JLabel sexLabel = new JLabel(resourceBundle.getString("shanoir.uploader.sexLabel"));
sexLabel.setHorizontalAlignment(SwingConstants.RIGHT);
GridBagConstraints gBCSexLabel = new GridBagConstraints();
gBCSexLabel.anchor = GridBagConstraints.EAST;
gBCSexLabel.insets = new Insets(10, 10, 10, 10);
gBCSexLabel.gridx = 0;
gBCSexLabel.gridy = 5;
editPanel.add(sexLabel, gBCSexLabel);
sexGBconstraints.anchor = GridBagConstraints.EAST;
sexGBconstraints.gridx = 0;
sexGBconstraints.gridy = 5;
editPanel.add(sexLabel, sexGBconstraints);

JPanel sexRadioPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
sexRG = new ButtonGroup();
fSexR = new JRadioButton("F");

fSexR = new JRadioButton(resourceBundle.getString("shanoir.uploader.sex.F"));
fSexR.setEnabled(false);
sexRG.add(fSexR);
editPanel.add(fSexR);
mSexR = new JRadioButton("M");
sexRadioPanel.add(fSexR);

mSexR = new JRadioButton(resourceBundle.getString("shanoir.uploader.sex.M"));
mSexR.setEnabled(false);
sexRG.add(mSexR);
editPanel.add(mSexR);
oSexR = new JRadioButton("O");
sexRadioPanel.add(mSexR);

oSexR = new JRadioButton(resourceBundle.getString("shanoir.uploader.sex.O"));
oSexR.setEnabled(false);
sexRG.add(oSexR);
editPanel.add(oSexR);
GridBagConstraints gBCFSexR = new GridBagConstraints();
gBCFSexR.insets = new Insets(10, 10, 10, 10);
gBCFSexR.fill = GridBagConstraints.HORIZONTAL;
gBCFSexR.gridx = 1;
gBCFSexR.gridy = 5;
gBCFSexR.weightx = 1.0;
editPanel.add(fSexR, gBCFSexR);
GridBagConstraints gBCMSexR = new GridBagConstraints();
gBCMSexR.insets = new Insets(10, 10, 10, 10);
gBCMSexR.fill = GridBagConstraints.HORIZONTAL;
gBCMSexR.gridx = 2;
gBCMSexR.gridy = 5;
gBCMSexR.weightx = 1.0;
editPanel.add(mSexR, gBCMSexR);
GridBagConstraints gBCOSexR = new GridBagConstraints();
gBCOSexR.insets = new Insets(10, 10, 10, 10);
gBCOSexR.fill = GridBagConstraints.HORIZONTAL;
gBCOSexR.gridx = 3;
gBCOSexR.gridy = 5;
gBCOSexR.weightx = 1.0;
editPanel.add(oSexR, gBCOSexR);
sexRadioPanel.add(oSexR);

sexGBconstraints.gridx = 1;
sexGBconstraints.gridy = 5;
sexGBconstraints.gridwidth = 3;
sexGBconstraints.anchor = GridBagConstraints.WEST;
sexGBconstraints.fill = GridBagConstraints.HORIZONTAL;
editPanel.add(sexRadioPanel, sexGBconstraints);

/**
* Last button for download or copy action:
Expand Down
9 changes: 7 additions & 2 deletions shanoir-uploader/src/main/resources/messages_en.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
shanoir.uploader.BirthDateLabel=Birth date:
shanoir.uploader.BirthNameLabel=Birth name:
shanoir.uploader.copyLastNameToBirthName=Copy last name as birth name
shanoir.uploader.cancel=Cancel
shanoir.uploader.configurationMenu.dicomServer.aetLabel=AET:
shanoir.uploader.configurationMenu.dicomServer.checkFormEchoParameters.mandatoryFields.message=Fill in all mandatory fields: AET, Host Name and Port
Expand Down Expand Up @@ -31,7 +32,7 @@ shanoir.uploader.configurationMenu.dicomServer.localPortLabel=Local Port:
shanoir.uploader.configurationMenu.dicomServer.portLabel=Port:
shanoir.uploader.configurationMenu.dicomServer.title=PACS (DICOM Server) Configuration
shanoir.uploader.configurationMenu.dicomServer=PACS (DICOM Server) Configuration
shanoir.uploader.configurationMenu.dicomServer.cmoveLabel=Attention: please verify with your PACS admin, that c-move is enabled for this connection!!!
shanoir.uploader.configurationMenu.dicomServer.cmoveLabel=Attention: please verify with your PACS admin, that c-move is enabled for this connection !!!
shanoir.uploader.configurationMenu.language.configure.english.message.part1= Congratulation! ShanoirUploader language is set to ENGLISH
shanoir.uploader.configurationMenu.language.configure.english.message.part2= Please restart ShanoirUploader application
shanoir.uploader.configurationMenu.language.configure.french.message.part1= Congratulation! ShanoirUploader language is set to FRENCH
Expand Down Expand Up @@ -61,7 +62,7 @@ shanoir.uploader.configurationMenu.shanoirServer.userName=User Name:
shanoir.uploader.configurationMenu.shanoirServer=Shanoir Server Configuration
shanoir.uploader.configurationMenu=Configuration
shanoir.uploader.connect=Connect
shanoir.uploader.connect.later=Connect later
shanoir.uploader.connect.later=Offline Mode
shanoir.uploader.contact.admin=Please contact your administrator : [email protected]
shanoir.uploader.createSubjectButton=Create Subject
shanoir.uploader.currentCopyOrDownloadSummary=Current copies or downloads:
Expand Down Expand Up @@ -233,12 +234,16 @@ shanoir.uploader.proxy.ssl=Secure SSL
shanoir.uploader.queryBoxMessage=<html><b>Query PACS (DICOM Server)</b></html>
shanoir.uploader.queryButton=<html><b>Query PACS</b></html>
shanoir.uploader.queryLevelLabel=Query level:
shanoir.uploader.queryLevelStudy=Study
shanoir.uploader.select.error.message.study=Please select only one study at a time.
shanoir.uploader.select.error.message.subject=Please select only one subject at a time.
shanoir.uploader.select.error.title=Data error
shanoir.uploader.sendBoxMessage=<html><b>Patient Data Verification</b></html>
shanoir.uploader.separatorMrExaminationLabel=Examination info
shanoir.uploader.sexLabel=Sex:
shanoir.uploader.sex.F=Female
shanoir.uploader.sex.M=Male
shanoir.uploader.sex.O=Other
shanoir.uploader.startedUploadsSummary=Started uploads:
shanoir.uploader.startup.remote.server.down=Shanoir server is not running
shanoir.uploader.startup.test.connection.fail=Shanoir test connection ... FAIL
Expand Down
17 changes: 11 additions & 6 deletions shanoir-uploader/src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
shanoir.uploader.BirthDateLabel=Date de naissance :
shanoir.uploader.BirthNameLabel=Nom de naissance :
shanoir.uploader.copyLastNameToBirthName=Copier le nom en tant que nom de naissance
shanoir.uploader.cancel=Annuler
shanoir.uploader.configurationMenu.dicomServer.aetLabel=AET :
shanoir.uploader.configurationMenu.dicomServer.checkFormEchoParameters.mandatoryFields.message=Remplissez tous les champs obligatoires : AET, Nom du Host and Port
Expand Down Expand Up @@ -31,7 +32,7 @@ shanoir.uploader.configurationMenu.dicomServer.localPortLabel=Port local:
shanoir.uploader.configurationMenu.dicomServer.portLabel=Port:
shanoir.uploader.configurationMenu.dicomServer.title=Configuration du serveur DICOM
shanoir.uploader.configurationMenu.dicomServer=Configuration du serveur DICOM
shanoir.uploader.configurationMenu.dicomServer.cmoveLabel=Attention : \u00E0 bien verifier avec le administrator de PACS : c-move est activ\u00E9 pour la connexion!!!
shanoir.uploader.configurationMenu.dicomServer.cmoveLabel=Attention : verifiez avec l'administrateur du PACS que le DICOM C-MOVE est activ\u00E9 pour la connexion !!!
shanoir.uploader.configurationMenu.language.configure.english.message.part1= F\u00E9licitation! La langue est r\u00E9gl\u00E9e sur ANGLAIS
shanoir.uploader.configurationMenu.language.configure.english.message.part2= Red\u00E9marrez l'application ShanoirUploader
shanoir.uploader.configurationMenu.language.configure.french.message.part1= F\u00E9licitation! La langue est r\u00E9gl\u00E9e sur FRANCAIS
Expand Down Expand Up @@ -60,8 +61,8 @@ shanoir.uploader.configurationMenu.shanoirServer.title=Configuration du serveur
shanoir.uploader.configurationMenu.shanoirServer.userName=Nom d'utilisateur:
shanoir.uploader.configurationMenu.shanoirServer=Configuration du serveur Shanoir
shanoir.uploader.configurationMenu=Configuration
shanoir.uploader.connect=Connection
shanoir.uploader.connect.later=Connection plus tard
shanoir.uploader.connect=Connexion
shanoir.uploader.connect.later=Mode hors ligne
shanoir.uploader.contact.admin=Veuillez contacter votre administrateur : [email protected]
shanoir.uploader.createSubjectButton=Cre\u00E9r le sujet
shanoir.uploader.currentCopyOrDownloadSummary=Copies ou t\u00e9l\u00e9chargements actuels :
Expand Down Expand Up @@ -234,17 +235,21 @@ shanoir.uploader.proxy.save=Enregistrer les changements
shanoir.uploader.proxy.ssl=SSL actif ?
shanoir.uploader.queryBoxMessage=<html><b>Requ\u00eater le PACS (serveur DICOM)</b></html>
shanoir.uploader.queryButton=<html><b>Requ\u00eater le PACS</b></html>
shanoir.uploader.queryLevelLabel=Niveau de requete :
shanoir.uploader.queryLevelLabel=Niveau de requ\u00eate :
shanoir.uploader.queryLevelStudy=Etude
shanoir.uploader.select.error.message.study=Veuillez s\u00E9lectionner une seule \u00E9tude \u00E0 la fois.
shanoir.uploader.select.error.message.subject=Veuillez s\u00E9lectionnez un seul sujet \u00E0 la fois.
shanoir.uploader.select.error.title=Erreur
shanoir.uploader.sendBoxMessage=<html><b>Verification du patient</b></html>
shanoir.uploader.separatorMrExaminationLabel=Infos Examen
shanoir.uploader.sexLabel=Sexe :
shanoir.uploader.sex.F=F\u00E9minin
shanoir.uploader.sex.M=Masculin
shanoir.uploader.sex.O=Autre
shanoir.uploader.startedUploadsSummary=Imports commenc\u00E9s :
shanoir.uploader.startup.remote.server.down=Le serveur Shanoir ne r\u00E9pond pas.
shanoir.uploader.startup.test.connection.fail=Shanoir test de connection ... ERREUR
shanoir.uploader.startup.test.connection.success=Shanoir test de connection ... OK
shanoir.uploader.startup.test.connection.fail=Shanoir test de connexion ... ERREUR
shanoir.uploader.startup.test.connection.success=Shanoir test de connexion ... OK
shanoir.uploader.startup.test.login.fail=Shanoir test login/mot de passe ... ERREUR
shanoir.uploader.startup.test.login.success=Shanoir test login/mot de passe ... OK
shanoir.uploader.startup.test.proxy.fail=Test de proxy ... ERREUR
Expand Down

0 comments on commit b844374

Please sign in to comment.