# Slicer custom application deployment to many computers

**URL:** <https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019>\
**Category:** Development\
**Tags:** slicelet\
**Created:** [February 11, 2021, 3:59pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019 "2021-02-11T15:59:23Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 29, 2021, 2:33pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/102 "2021-07-29T14:33:24Z")

</div>

> [@pieper](#):
>
> Also this tool can help flag non-conformities:
> 
> [DICOM Validator - dciodvfy](https://www.dclunie.com/dicom3tools/dciodvfy.html)

Do you like this tool better than DVTk? (DICOM Validation Toolkit - www.dvtk.org)

Also, do you know where I can find valid DICOM file containing Encapsulated format Pixel Data? Is there a site where we can access standard DICOM data with which we can compare our data?

Thanks

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 29, 2021, 2:48pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/103 "2021-07-29T14:48:13Z")

</div>

> [@spycolyf](#):
>
> Do you like this tool better than DVTk? (DICOM Validation Toolkit - [www.dvtk.org](http://www.dvtk.org))

I’ve never used dvtk, thanks for pointing it out.

dciodvfy is written by David Clunie, editor of the dicom standard, so it’s usually a pretty rigorous and informative test. In the end if your goal is to make things interoperable you probably want to use anything and everything you can get your hands on to make sure the data you are generating is as standards compliant as possible. This is usually the best way to avoid surprises down the line.

> [@spycolyf](#):
>
> Also, do you know where I can find valid DICOM file containing Encapsulated format Pixel Data? Is there a site where we can access standard DICOM data with which we can compare our data?

I wish there were a definitive collection of valid example dicom objects demonstrating the full range of legal variants, but I’ve never found such a collection. Best I can suggest is [the TCIA collections](https://www.cancerimagingarchive.net/) (or the subset hosted through [IDC](https://imaging.datacommons.cancer.gov/)).

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 29, 2021, 2:59pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/104 "2021-07-29T14:59:23Z")

</div>

Good Morning,

I’m confused about how to interpret the log files. Here’s an example of the heap logs…

[DEBUG][Qt] 28.07.2021 16:12:06 [] (unknown:0) - “DICOM indexer has successfully inserted 929 files [0.56s]”  
[DEBUG][Qt] 28.07.2021 16:12:06 [] (unknown:0) - “DICOM indexer has successfully processed 929 files [2.71s]”

```auto
[DEBUG][Qt] 28.07.2021 16:12:06 [] (unknown:0) - "DICOM indexer has updated display fields for 929 files [0.22s]"
[INFO][Python] 28.07.2021 16:15:17 [Python] (C:/Program Files/Mayo Foundation/QREADS_3D_MPR/bin/../lib/SlicerQReads-4.13/qt-scripted-modules/DICOMScalarVolumePlugin.py:384) - Loading with imageIOName: GDCM
[INFO][Stream] 28.07.2021 16:15:17 [] (unknown:0) - Loading with imageIOName: GDCM
[INFO][Stream] 28.07.2021 16:15:42 [] (unknown:0) - default Window / level = 1673.0 / -187.5

```

You can see a 3 minute difference between the 1st and 2nd lines. There are 23,000 lines in this log file and during the whole three minutes we can see the log file growing, and when it stops at around 3000KB, the app displays the images. Yet in the smaller Stack logs the time between the 1st and second lines in about 25 seconds. Is all of that time spent writing out the log file?

Thanks

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 29, 2021, 5:33pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/105 "2021-07-29T17:33:56Z")

</div>

Yes, if you are really getting 23,000 lines of output then the logging system is likely to get choked. It would be good if slicer’s logging was faster, but it’s still better to fix the dicom instead.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 29, 2021, 11:31pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/106 "2021-07-29T23:31:40Z")

</div>

Corrected the main cause that produced the most log lines. But now it’s putting out thousands of these…

```auto
[CRITICAL][Stream] 29.07.2021 17:40:48 [] (unknown:0) - W: DcmMetaInfo: No Group Length available in Meta Information Header
[CRITICAL][Stream] 29.07.2021 17:40:48 [] (unknown:0) - W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

```

1. Why is it generating the “No Group Length available in Meta Information Header” lines? Is it a mandatory element?
2. A “-1” in the element (7fe0,0010) length is valid DICOM meaning “Undefined”. It’s OK for Encapsulated Pixel Data. So why generate log output.

I really wish there was a way to turn of logging or control the severity. It’s really affecting my load times. Minutes to load 925 images. The Docs will just stop using 3D MPR.

Are you sure there’s no way to turn it off? Should I be able to find the code to shut it off? I know you don’t recommend it, but is the less of the 2 evils because tomorrow is my dev cutoff day.

Thanks!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 29, 2021, 11:45pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/107 "2021-07-29T23:45:25Z")

</div>

Since you are building from source, you have the option to change dcmtk’s behavior here. If you can’t find a way to change the logging, you can search for the substrings of the error message and comment out the messages you don’t want (again, it’s not what I’d recommend, but it would be a workaround).

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 29, 2021, 11:50pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/108 "2021-07-29T23:50:18Z")

</div>

OK, these files have no “0002,0000) - File Meta Information Group Length” elements. I’ll try to insert it. That may get rid of the “No Group Length available in Meta Information Header” warning.

But, do you allow the length of the Pixel data to be -1 or Undefined as listed here?..

Here is our [7FE0, 0010] pixel data tags for Implicit VR Little Endian encapsulated pixel data…

```auto
00008a66 ( 35430)	(7FE0,0010) - Pixel Data [OW][UNDEFN][1]: 
00008a72 ( 35442) (FFFE,E000) - Item [][4][1]: 
00008a7e ( 35454) (FFFE,E000) - Item [][183848][0]: 
000358ae ( 219310)	|--->(FFFE,E0DD) - Sequence Delimitation Item [][0][0]:

```

Is the “UNDEFN” is actually -1 which is not a multiple of 2 and it’s legal DICOM I believe. Is this why the “Length of element (7fe0,0010) is not a multiple of 2” problem? Do you think it’s a Slicer bug?

Thanks

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 29, 2021, 11:58pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/109 "2021-07-29T23:58:24Z")

</div>

I believe all those warnings originate from DCMTK so it’s really not Slicer that is in control of determining the logic. Slicer is just reporting the warnings of DCMTK.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 30, 2021, 12:44am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/110 "2021-07-30T00:44:22Z")

</div>

OK thanks a lot. I wonder if there is a way to configure DCMTK to control logging. I’ll look into it. Thanks for all of your help.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 30, 2021, 2:18pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/111 "2021-07-30T14:18:30Z")

</div>

I will look for the code that generates the logs. Any hints would be greatly appreciated. Thanks. 🙂

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 30, 2021, 2:32pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/112 "2021-07-30T14:32:03Z")

</div>

I believe you are using a SlicerCustomApplicationTemplate, which I haven’t used myself fir this but you should have a way to access the superbuild cmake script for DCMTK corresponding to [this one](https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_DCMTK.cmake) for Slicer itself. DCMTK uses log4cpp and probably the configuration variables for that are exposed in CMake, but you’ll need to do some research to figure out what options there are for turning off warning messages. HTH.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 31, 2021, 4:28pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/113 "2021-07-31T16:28:13Z")

</div>

> [@pieper](#):
>
> CMake, but you’ll need to do some research to figure out what options there are for turning off warning messages. HTH.

I see absolutely nothing in there that gives the slightest hint of controlling error or warning messages.

Are the logs written out by ITK? I found C:.…\TK\Modules\IO\DCMTK\src\itkDCMTKFileReader.cxx that seems to deal with the reading of DCMs, But I can’t find where it’s actually writing to the log files. Are you familiar enough in this space to know what Slicer Code Repository search string I can use to find the code that writes to the log files?

Thank you.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 31, 2021, 5:58pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/114 "2021-07-31T17:58:35Z")

</div>

Most of the messages you copied here come from dcmtk. For Slicer builds we use this fork of dcmtk:

> **[GitHub - commontk/DCMTK at patched-DCMTK-3.6.6\_20210115](https://github.com/commontk/DCMTK/tree/patched-DCMTK-3.6.6_20210115)**
>
> patched-DCMTK-3.6.6\_20210115

You can search for the warning messages from the log file and see what code is generating the messages.

But again, from what I can see these indicate errors in the format of the data. It sounds from your messages that you have control over the way these files are written and that is the correct place to fix them. Do you not agree?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 31, 2021, 7:35pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/115 "2021-07-31T19:35:02Z")

</div>

You can control log level in DCMTK, in CTK, and in Slicer and we could add some convenient and easier-to-discover API for changing log levels at runtime.

However, these are invalid DICOM files, so suppressing logs does not sound like a good idea. You want to be able to see warnings and report the issues to developers of the software that created the invalid files (in more severe cases, even report to users to make them aware that the data may be corrupted).

What DICOM toolkit do you use that create pixel data with undefined length? That’s a major issue, because many DICOM toolkit may simply refuse to load such data sets.

As a corrective action, I would recommend fixing the DICOM files. As a preventive action, we could try to improve speed of logging in Slicer.

Log files are already rotated. The number of log files preserved is set to 15 or so, and you can configure the number in the Slicer application configuration file. Cutting off a log file in the middle of a session makes it harder to collect complete log files from customers and make it harder for developers to analyze the logs, so I would not recommend doing it.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [August 1, 2021, 12:15am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/116 "2021-08-01T00:15:54Z")

</div>

OK, yes. I think you’re right.

After further review …

1. Maybe, `(7FE0,0010) - Pixel Data [OW][UNDEFN][1]` should be of type OB rather than OW, and maybe that’s why it’s flagged as not being a multiple of 2 bytes.

2. And yes, GEL (0002, 0000) is type 1.

We should try to fix this first.

Thanks!

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [August 1, 2021, 12:37am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/117 "2021-08-01T00:37:27Z")

</div>

@lassoan @pieper @jamesobutler\

Hi. Please forgive me for so many questions, but we are preparing for this major release of QREADS with the SlicerQREADS extension. For controlling the number of log files and the temporary database folders, we will use our QREADS launcher code to delete older files.

The question was asked by my lead of whether there is a way to set the path of logging folder different from C:\Users\userID\AppData\Local\Temp\SlicerQReads.

Thanks

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [August 1, 2021, 2:46am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/118 "2021-08-01T02:46:49Z")

</div>

> [@spycolyf](#):
>
> Maybe, `(7FE0,0010) - Pixel Data [OW][UNDEFN][1]` should be of type OB rather than OW, and maybe that’s why it’s flagged as not being a multiple of 2 bytes.

Changing the type to OB fixed that error.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [August 1, 2021, 2:48am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/119 "2021-08-01T02:48:31Z")

</div>

> [@spycolyf](#):
>
> And yes, GEL (0002, 0000) is type 1.

Now trying to figure out how to insert the mandatory (0002, 0000) into the header, and that should fix that error.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 1, 2021, 2:49am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/120 "2021-08-01T02:49:10Z")

</div>

> [@spycolyf](#):
>
> For controlling the number of log files and the temporary database folders, we will use our QREADS launcher code to delete older files.

There is no need to manage the log files externally. You can set the number of log files to 1 if you only want to keep the log file of the last session.

> [@spycolyf](#):
>
> The question was asked by my lead of whether there is a way to set the path of logging folder different from C:\Users\userID\AppData\Local\Temp\SlicerQReads.

The log file location is [in the temporary folder specified by `TemporaryPath` in Slicer.ini](https://github.com/Slicer/Slicer/blob/b44b89f2c94b6a44ab5362352fa2ee1b01ff3730/Base/QTGUI/qSlicerApplication.cxx#L863-L870). If needed, it would be easy to add an optional settings value to specify a custom location.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [August 1, 2021, 2:53am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/121 "2021-08-01T02:53:32Z")

</div>

> [@spycolyf](#):
>
> For controlling the number of log files and the temporary database folders, we will use our QREADS launcher code to delete older files.

Thanks, how about the Temporary database folders? They are not so temporary. They don’t seem to be ever deleted.

Thanks

[Previous page](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019.md?page=5)

[Next page](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019.md?page=7)
