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

Reformat json DeidentificationMethod #857

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,20 @@ tse3d: T2*/
fprintf(fp, "\t\"NonlinearGradientCorrection\": false,\n");
if (d.isDerived) //DICOM is derived image or non-spatial file (sounds, etc)
fprintf(fp, "\t\"RawImage\": false,\n");
json_Str(fp, "\t\"DeidentificationMethod\": \"%s\",\n", d.deidentificationMethod);
if (strlen(d.deidentificationMethod) > 0) {
fprintf(fp, "\t\"DeidentificationMethod\": [\"");
bool isSep = false;
for (size_t i = 0; i < strlen(d.deidentificationMethod); i++) {
if (d.deidentificationMethod[i] != '\\') {
if (isSep)
fprintf(fp, "\", \"");
isSep = false;
fprintf(fp, "%c", d.deidentificationMethod[i]);
} else
isSep = true;
}
fprintf(fp, "\"],\n");
}
if(d.deID_CS_n>0)
{
fprintf(fp, "\t\"DeidentificationMethodCodeSequence\": [ \n");
Expand Down
Loading